class_docstr: An actor class.
  
  This is a decorated class. It can be used to create actors.
  
  Attributes:
      __ray_metadata__: Contains metadata for the actor.
class_docstr_tok: ["An","actor","class",".","This","is","a","decorated","class",".","It","can","be","used","to","create","actors",".","Attributes",":","__ray_metadata__",":","Contains","metadata","for","the","actor","."]
code: def _ray_from_modified_class(
      cls,
      modified_class,
      class_id,
      actor_options,
  ):
      for attribute in [
          "remote",
          "_remote",
          "_ray_from_modified_class",
          "_ray_from_function_descriptor",
      ]:
          if hasattr(modified_class, attribute):
              logger.warning(
                  "Creating an actor from class "
                  f"{modified_class.__name__} overwrites "
                  f"attribute {attribute} of that class"
              )
  
      # Make sure the actor class we are constructing inherits from the
      # original class so it retains all class properties.
      class DerivedActorClass(cls, modified_class):
          def __init__(self, *args, **kwargs):
              try:
                  cls.__init__(self, *args, **kwargs)
              except Exception as e:
                  # Delegate call to modified_class.__init__ only
                  # if the exception raised by cls.__init__ is
                  # TypeError and not ActorClassInheritanceException(TypeError).
                  # In all other cases proceed with raise e.
                  if isinstance(e, TypeError) and not isinstance(
                      e, ActorClassInheritanceException
                  ):
                      modified_class.__init__(self, *args, **kwargs)
                  else:
                      raise e
  
      name = f"ActorClass({modified_class.__name__})"
      DerivedActorClass.__module__ = modified_class.__module__
      DerivedActorClass.__name__ = name
      DerivedActorClass.__qualname__ = name
      # Construct the base object.
      self = DerivedActorClass.__new__(DerivedActorClass)
      # Actor creation function descriptor.
      actor_creation_function_descriptor = (
          PythonFunctionDescriptor.from_class(
              modified_class.__ray_actor_class__
          )
      )
  
      self.__ray_metadata__ = _ActorClassMetadata(
          Language.PYTHON,
          modified_class,
          actor_creation_function_descriptor,
          class_id,
          **_process_option_dict(actor_options),
      )
      self._default_options = actor_options
      if "runtime_env" in self._default_options:
          self._default_options[
              "runtime_env"
          ] = self.__ray_metadata__.runtime_env
  
      return self
  
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 3 for calling the ActorClass obj's underlying member method code with example usage: obj._ray_from_modified_class(cls, modified_class, class_id, actor_options) and returns: self