code: def _get_expected_row_ids_and_row_dicts_for_partition_order(
      df, partition_order
  ):
      expected_row_ids_and_row_dicts = []
      for part_id in partition_order:
          partition = df.where(
              f"SPARK_PARTITION_ID() = {part_id}"
          ).collect()
          for row_idx, row in enumerate(partition):
              expected_row_ids_and_row_dicts.append(
                  (f"{part_id}_{row_idx}", row.asDict())
              )
      return expected_row_ids_and_row_dicts
  
file_path: datasets/tests/packaged_modules/test_spark.py
imports: from unittest.mock import patch
  import pyspark
  from datasets.packaged_modules.spark.spark import Spark, SparkExamplesIterable, _generate_iterable_examples
  from ..utils import require_dill_gt_0_3_2, require_not_windows
label_desc: Use image node_id 1 for calling a global function with example usage: _get_expected_row_ids_and_row_dicts_for_partition_order(df, partition_order) and returns: expected_row_ids_and_row_dicts