class_docstr: A handle to an actor.
  
  The fields in this class are prefixed with _ray_ to hide them from the user
  and to avoid collision with actor method names.
  
  An ActorHandle can be created in three ways. First, by calling .remote() on
  an ActorClass. Second, by passing an actor handle into a task (forking the
  ActorHandle). Third, by directly serializing the ActorHandle (e.g., with
  cloudpickle).
  
  Attributes:
      _ray_actor_language: The actor language.
      _ray_actor_id: Actor ID.
      _ray_method_is_generator: Map of method name -> if it is a generator
          method.
      _ray_method_decorators: Optional decorators for the function
          invocation. This can be used to change the behavior on the
          invocation side, whereas a regular decorator can be used to change
          the behavior on the execution side.
      _ray_method_signatures: The signatures of the actor methods.
      _ray_method_max_retries: Max number of retries on method failure.
      _ray_method_num_returns: The default number of return values for
          each method.
      _ray_method_retry_exceptions: The default value of boolean of whether you want
          to retry all user-raised exceptions, or a list of allowlist exceptions to
          retry.
      _ray_method_generator_backpressure_num_objects: Generator-only
          config. The max number of objects to generate before it
          starts pausing a generator.
      _ray_actor_method_cpus: The number of CPUs required by actor methods.
      _ray_original_handle: True if this is the original actor handle for a
          given actor. If this is true, then the actor will be destroyed when
          this handle goes out of scope.
      _ray_is_cross_language: Whether this actor is cross language.
      _ray_actor_creation_function_descriptor: The function descriptor
          of the actor creation task.
class_docstr_tok: ["A","handle","to","an","actor",".","The","fields","in","this","class","are","prefixed","with","_ray_","to","hide","them","from","the","user","and","to","avoid","collision","with","actor","method","names",".","An","ActorHandle","can","be","created","in","three","ways",".","First",",","by","calling",".remote","(",")","on","an","ActorClass",".","Second",",","by","passing","an","actor","handle","into","a","task","(","forking","the","ActorHandle",")",".","Third",",","by","directly","serializing","the","ActorHandle","(","e.g.",",","with","cloudpickle",")",".","Attributes",":","_ray_actor_language",":","The","actor","language",".","_ray_actor_id",":","Actor","ID",".","_ray_method_is_generator",":","Map","of","method","name","-",">","if","it","is","a","generator","method",".","_ray_method_decorators",":","Optional","decorators","for","the","function","invocation",".","This","can","be","used","to","change","the","behavior","on","the","invocation","side",",","whereas","a","regular","decorator","can","be","used","to","change","the","behavior","on","the","execution","side",".","_ray_method_signatures",":","The","signatures","of","the","actor","methods",".","_ray_method_max_retries",":","Max","number","of","retries","on","method","failure",".","_ray_method_num_returns",":","The","default","number","of","return","values","for","each","method",".","_ray_method_retry_exceptions",":","The","default","value","of","boolean","of","whether","you","want","to","retry","all","user-raised","exceptions",",","or","a","list","of","allowlist","exceptions","to","retry",".","_ray_method_generator_backpressure_num_objects",":","Generator-only","config",".","The","max","number","of","objects","to","generate","before","it","starts","pausing","a","generator",".","_ray_actor_method_cpus",":","The","number","of","CPUs","required","by","actor","methods",".","_ray_original_handle",":","True","if","this","is","the","original","actor","handle","for","a","given","actor",".","If","this","is","true",",","then","the","actor","will","be","destroyed","when","this","handle","goes","out","of","scope",".","_ray_is_cross_language",":","Whether","this","actor","is","cross","language",".","_ray_actor_creation_function_descriptor",":","The","function","descriptor","of","the","actor","creation","task","."]
code: def __init__(
      self,
      language,
      actor_id,
      max_task_retries: Optional[int],
      method_is_generator: Dict[str, bool],
      method_decorators,
      method_signatures,
      method_num_returns: Dict[str, int],
      method_max_retries: Dict[str, int],
      method_retry_exceptions: Dict[str, Union[bool, list, tuple]],
      method_generator_backpressure_num_objects: Dict[str, int],
      actor_method_cpus: int,
      actor_creation_function_descriptor,
      session_and_job,
      original_handle=False,
  ):
      self._ray_actor_language = language
      self._ray_actor_id = actor_id
      self._ray_max_task_retries = max_task_retries
      self._ray_original_handle = original_handle
      self._ray_method_is_generator = method_is_generator
      self._ray_method_decorators = method_decorators
      self._ray_method_signatures = method_signatures
      self._ray_method_num_returns = method_num_returns
      self._ray_method_max_retries = method_max_retries
      self._ray_method_retry_exceptions = method_retry_exceptions
      self._ray_method_generator_backpressure_num_objects = (
          method_generator_backpressure_num_objects
      )
      self._ray_actor_method_cpus = actor_method_cpus
      self._ray_session_and_job = session_and_job
      self._ray_is_cross_language = language != Language.PYTHON
      self._ray_actor_creation_function_descriptor = (
          actor_creation_function_descriptor
      )
      self._ray_function_descriptor = {}
  
      if not self._ray_is_cross_language:
          assert isinstance(
              actor_creation_function_descriptor,
              PythonFunctionDescriptor,
          )
          module_name = actor_creation_function_descriptor.module_name
          class_name = actor_creation_function_descriptor.class_name
          for method_name in self._ray_method_signatures.keys():
              function_descriptor = PythonFunctionDescriptor(
                  module_name, method_name, class_name
              )
              self._ray_function_descriptor[
                  method_name
              ] = function_descriptor
              method = ActorMethod(
                  self,
                  method_name,
                  self._ray_method_num_returns[method_name],
                  self._ray_method_max_retries.get(
                      method_name, self._ray_max_task_retries
                  )
                  or 0,  # never None
                  self._ray_method_retry_exceptions.get(method_name),
                  self._ray_method_is_generator[method_name],
                  self._ray_method_generator_backpressure_num_objects.get(
                      method_name
                  ),  # noqa
                  decorator=self._ray_method_decorators.get(
                      method_name
                  ),
              )
              setattr(self, method_name, method)
  
imports: import inspect
  import logging
  import weakref
  from typing import Any, Dict, List, Optional, Union
  import ray._private.ray_constants
  import ray._private.signature
  import ray._private.worker
  import ray._raylet
  from ray import ActorClassID, Language, cross_language
  from ray._private import ray_option_utils
  from ray._private.async_compat import is_async_func
  from ray._private.auto_init_hook import wrap_auto_init
  from ray._private.client_mode_hook import client_mode_convert_actor, client_mode_hook, client_mode_should_convert
  from ray._private.inspect_util import is_class_method, is_function_or_method, is_static_method
  from ray._private.ray_option_utils import _warn_if_using_deprecated_placement_group
  from ray._private.utils import get_runtime_env_info, parse_runtime_env
  from ray._raylet import STREAMING_GENERATOR_RETURN, ObjectRefGenerator, PythonFunctionDescriptor, raise_sys_exit_with_custom_error_message
  from ray.exceptions import AsyncioActorExit
  from ray.util.annotations import DeveloperAPI, PublicAPI
  from ray.util.placement_group import _configure_placement_group_based_on_context
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy, SchedulingStrategyT
  from ray.util.tracing.tracing_helper import _inject_tracing_into_class, _tracing_actor_creation, _tracing_actor_method_invocation
label_desc: Use image node_id 1 to create a new ActorHandle object  with example: obj = ActorHandle(language, actor_id, max_task_retries, method_is_generator, method_decorators, method_signatures, method_num_returns, method_max_retries, method_retry_exceptions, method_generator_backpressure_num_objects, actor_method_cpus, actor_creation_function_descriptor, session_and_job, original_handle)