code: def test_configure_locality(enable_locality):
      options = DataConfig.default_ingest_options()
      options.locality_with_output = enable_locality
      data_config = DataConfig(execution_options=options)
  
      mock_ds = MagicMock()
      mock_ds.streaming_split = MagicMock()
      mock_ds.copy = MagicMock(return_value=mock_ds)
      world_size = 2
      worker_handles = [MagicMock() for _ in range(world_size)]
      worker_node_ids = ["node" + str(i) for i in range(world_size)]
      data_config.configure(
          datasets={"train": mock_ds},
          world_size=world_size,
          worker_handles=worker_handles,
          worker_node_ids=worker_node_ids,
      )
      mock_ds.streaming_split.assert_called_once()
      mock_ds.streaming_split.assert_called_with(
          world_size,
          equal=True,
          locality_hints=worker_node_ids if enable_locality else None,
      )
  
imports: from typing import Optional
  import random
  import pytest
  from unittest.mock import MagicMock
  import ray
  from ray import train
  from ray.train import DataConfig, ScalingConfig
  from ray.data import DataIterator
  from ray.train.data_parallel_trainer import DataParallelTrainer
  from ray.data._internal.execution.interfaces.execution_options import ExecutionOptions
  from ray.tests.conftest import *
label_desc: Use image node_id 6 for calling a global function with example usage: test_configure_locality(enable_locality) without return types