code: def test_basic(ray_start_regular_shared, pandas):
      ds = ray.data.range(100, parallelism=10)
      ds = ds.add_column("embedding", lambda b: b["id"] ** 2)
      if not pandas:
          ds = ds.map_batches(
              lambda df: pyarrow.Table.from_pandas(df),
              batch_format="pandas",
          )
  
      rad = ds.to_random_access_dataset("id", num_workers=1)
  
      # Test get.
      assert ray.get(rad.get_async(-1)) is None
      assert ray.get(rad.get_async(100)) is None
      for i in range(100):
          assert ray.get(rad.get_async(i)) == {
              "id": i,
              "embedding": i**2,
          }
  
      def expected(i):
          return {"id": i, "embedding": i**2}
  
      # Test multiget.
      results = rad.multiget([-1] + list(range(10)) + [100])
      assert results == [None] + [expected(i) for i in range(10)] + [
          None
      ]
  
file_path: ray/python/ray/data/tests/test_random_access.py
imports: import pyarrow
  import pytest
  import ray
  from ray.tests.conftest import *
label_desc: Use image node_id 1 for calling a global function with example usage: test_basic(ray_start_regular_shared, pandas) and returns: dict