code: def test_calculate_ref_hits(ray_start_regular_shared):
      refs = [ray.put(0), ray.put(1)]
      hits, misses, unknowns = _calculate_ref_hits(refs)
      assert hits == 0
      assert misses == 0
      assert unknowns == 0
  
      ctx = ray.data.context.DataContext.get_current()
      ctx.enable_get_object_locations_for_metrics = True
      hits, misses, unknowns = _calculate_ref_hits(refs)
      assert hits == 2
      assert misses == 0
      assert unknowns == 0
  
imports: import threading
  import time
  import numpy
  import pandas
  import pyarrow
  import pytest
  import ray
  from ray.data._internal.block_batching.interfaces import Batch
  from ray.data._internal.block_batching.util import _calculate_ref_hits, blocks_to_batches, collate, finalize_batches, format_batches, resolve_block_refs
  from ray.data._internal.util import Queue, make_async_gen
label_desc: Use image node_id 12 for calling a global function with example usage: test_calculate_ref_hits(ray_start_regular_shared) without return types