class_docstr: This is a Ray Tune-like execution flow.
  
  - We want to run 10 actors in total ("trials")
  - Each actor collects 11 results sequentially
  - We schedule up to 6 actors at the same time
  - Every step, we see if we should add any new actors
  - Otherwise, we just yield control to the event manager and process events one
    by one
  - When an actor is started, start training flow
  - When a result comes in, schedule next future
    - If this is the 11th result, stop actor
  - When the last actor is stopped, set state to finished
  
  - When an actor fails, restart
  - When a task fails, stop actor, and restart
class_docstr_tok: ["This","is","a","Ray","Tune-like","execution","flow",".","-","We","want","to","run","10","actors","in","total","(","``","trials","''",")","-","Each","actor","collects","11","results","sequentially","-","We","schedule","up","to","6","actors","at","the","same","time","-","Every","step",",","we","see","if","we","should","add","any","new","actors","-","Otherwise",",","we","just","yield","control","to","the","event","manager","and","process","events","one","by","one","-","When","an","actor","is","started",",","start","training","flow","-","When","a","result","comes","in",",","schedule","next","future","-","If","this","is","the","11th","result",",","stop","actor","-","When","the","last","actor","is","stopped",",","set","state","to","finished","-","When","an","actor","fails",",","restart","-","When","a","task","fails",",","stop","actor",",","and","restart"]
code: def actor_stopped(self, tracked_actor: TrackedActor):
      self._actors_stopped += 1
      self._finished = self._actors_stopped >= self._actors_to_run
  
imports: import random
  from collections import defaultdict
  from typing import Dict, List, Optional
  import pytest
  import ray
  from ray.air import ResourceRequest
  from ray.air.execution import FixedResourceManager, PlacementGroupResourceManager
  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 4 for calling the TuneFlow obj's underlying member method code with example usage: obj.actor_stopped(tracked_actor) without return types