code: def test_get_reader(shutdown_only):
      # Note: if you get TimeoutErrors here, try installing required dependencies
      # with `pip install -U "ray[default]"`.
      ray.init()
  
      head_node_id = ray.get_runtime_context().get_node_id()
  
      # Issue read so `_get_datasource_or_legacy_reader` being executed.
      ray.data.range(10).materialize()
  
      # Verify `_get_datasource_or_legacy_reader` being executed on same node (head node).
      def verify_get_reader():
          from ray.util.state import list_tasks
  
          task_states = list_tasks(
              filters=[
                  ("name", "=", "_get_datasource_or_legacy_reader")
              ]
          )
          # Verify only one task being executed on same node.
          assert len(task_states) == 1
          assert (
              task_states[0]["name"]
              == "_get_datasource_or_legacy_reader"
          )
          assert task_states[0]["node_id"] == head_node_id
          return True
  
      wait_for_condition(verify_get_reader, timeout=20)
  
imports: import os
  from typing import Iterable, List
  import pandas
  import pyarrow
  import pyarrow.parquet
  import pytest
  import torchvision
  from fsspec.implementations.http import HTTPFileSystem
  from fsspec.implementations.local import LocalFileSystem
  import ray
  from ray._private.test_utils import wait_for_condition
  from ray.data._internal.execution.interfaces import TaskContext
  from ray.data.block import Block, BlockAccessor
  from ray.data.datasource import Datasource, DummyOutputDatasource, WriteResult
  from ray.data.datasource.file_meta_provider import _handle_read_os_error
  from ray.data.tests.conftest import *
  from ray.data.tests.mock_http_server import *
  from ray.data.tests.util import extract_values
  from ray.tests.conftest import *
  from ray.types import ObjectRef
label_desc: Use image node_id 14 for calling a global function with example usage: test_get_reader(shutdown_only) and returns: True