class_docstr: This is a Ray Train-like execution flow.
  
  - We want to run 4 actors in total ("trials")
  - Each actor runs two init functions
  - We train all actors in parallel for 10 iterations
  - Errors can come up on actor construction, in the init functions,
    or during training
  - When an actor fails, restart that actor
  - When a task fails, stop actor, and restart
class_docstr_tok: ["This","is","a","Ray","Train-like","execution","flow",".","-","We","want","to","run","4","actors","in","total","(","``","trials","''",")","-","Each","actor","runs","two","init","functions","-","We","train","all","actors","in","parallel","for","10","iterations","-","Errors","can","come","up","on","actor","construction",",","in","the","init","functions",",","or","during","training","-","When","an","actor","fails",",","restart","that","actor","-","When","a","task","fails",",","stop","actor",",","and","restart"]
code: def setup_actors(self):
      for actor_id in range(self._actors_to_run):
          error_kwargs = {}
          if self._errors:
              error = random.choice(self._errors)
              error_kwargs[error] = True
  
          print("Actor", actor_id, "will be failing with", error_kwargs)
  
          tracked_actor = self._actor_manager.add_actor(
              cls=Actor,
              kwargs={"id": actor_id, **error_kwargs},
              resource_request=ResourceRequest([{"CPU": 1}]),
              on_start=self.actor_started,
              on_stop=self.actor_stopped,
              on_error=self.actor_error,
          )
          self._tracked_actors.append(tracked_actor)
  
imports: import random
  from typing import Any, List, Optional
  import pytest
  import ray
  from ray.air import ResourceRequest
  from ray.air.execution import FixedResourceManager, PlacementGroupResourceManager
  from ray.air.execution._internal import Barrier
  from ray.air.execution._internal.actor_manager import RayActorManager
  from ray.air.execution._internal.tracked_actor import TrackedActor
  from ray.exceptions import RayActorError
label_desc: Use image node_id 2 for calling the TrainFlow obj's underlying member method code with example usage: obj.setup_actors() without return types