code: def test_optimize_reorder(ray_start_regular_shared):
      context = DataContext.get_current()
      context.optimize_fuse_stages = True
      context.optimize_fuse_read_stages = True
      context.optimize_reorder_stages = True
  
      ds = (
          ray.data.range(10)
          .randomize_block_order()
          .map_batches(dummy_map)
          .materialize()
      )
      print("Stats", ds.stats())
      expect_stages(
          ds,
          2,
          ["ReadRange->MapBatches(dummy_map)", "RandomizeBlockOrder"],
      )
  
      ds2 = (
          ray.data.range(10)
          .randomize_block_order()
          .repartition(10)
          .map_batches(dummy_map)
          .materialize()
      )
      expect_stages(
          ds2,
          3,
          [
              "ReadRange",
              "RandomizeBlockOrder",
              "Repartition",
              "MapBatches(dummy_map)",
          ],
      )
  
imports: import os
  from typing import List
  import numpy
  import pandas
  import pytest
  import ray
  from ray._private.internal_api import memory_summary
  from ray.data import Dataset
  from ray.data.block import BlockMetadata
  from ray.data.context import DataContext
  from ray.data.datasource import Datasource, ReadTask
  from ray.data.datasource.csv_datasource import CSVDatasource
  from ray.data.tests.util import column_udf, extract_values
  from ray.tests.conftest import *
label_desc: Use image node_id 9 for calling a global function with example usage: test_optimize_reorder(ray_start_regular_shared) without return types