class_docstr: Block prefetcher using a local actor.
class_docstr_tok: ["Block","prefetcher","using","a","local","actor","."]
code: def _get_or_create_actor_prefetcher() -> "ActorHandle":
      node_id = ray.get_runtime_context().get_node_id()
      actor_name = f"dataset-block-prefetcher-{node_id}"
      return _BlockPretcher.options(
          scheduling_strategy=NodeAffinitySchedulingStrategy(
              node_id, soft=False
          ),
          name=actor_name,
          namespace=PREFETCHER_ACTOR_NAMESPACE,
          get_if_exists=True,
      ).remote()
  
imports: import logging
  import threading
  from contextlib import nullcontext
  from typing import Any, Callable, Iterator, List, Optional, Tuple
  import ray
  from ray.actor import ActorHandle
  from ray.data._internal.batcher import Batcher, ShufflingBatcher
  from ray.data._internal.block_batching.interfaces import Batch, BlockPrefetcher, CollatedBatch
  from ray.data._internal.stats import DatasetStats
  from ray.data.block import Block, BlockAccessor, DataBatch
  from ray.types import ObjectRef
  from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy
label_desc: Use image node_id 2 for calling the ActorBlockPrefetcher obj's underlying member method code with example usage: obj._get_or_create_actor_prefetcher() and returns: _BlockPretcher