class_docstr: The Client-side methods corresponding to the ray API. Delegates
  to the Client Worker that contains the connection to the ClientServer.
class_docstr_tok: ["The","Client-side","methods","corresponding","to","the","ray","API",".","Delegates","to","the","Client","Worker","that","contains","the","connection","to","the","ClientServer","."]
docstr: Annotate an actor method
  
  Args:
      num_returns: The number of object refs that should be returned by
          invocations of this actor method.
code: def method(self, *args, **kwargs):
      """Annotate an actor method
  
      Args:
          num_returns: The number of object refs that should be returned by
              invocations of this actor method.
      """
  
      # NOTE: So this follows the same logic as in ray/actor.py::method()
      # The reason to duplicate it here is to simplify the client mode
      # redirection logic. As the annotated method gets pickled and sent to
      # the server from the client it carries this private variable, it
      # activates the same logic on the server side; so there's no need to
      # pass anything else. It's inside the class definition that becomes an
      # actor. Similar annotations would follow the same way.
      valid_kwargs = ["num_returns", "concurrency_group"]
      error_string = (
          "The @ray.method decorator must be applied using at least one of "
          f"the arguments in the list {valid_kwargs}, for example "
          "'@ray.method(num_returns=2)'."
      )
      assert len(args) == 0 and len(kwargs) > 0, error_string
      for key in kwargs:
          key_error_string = (
              f'Unexpected keyword argument to @ray.method: "{key}". The '
              f"supported keyword arguments are {valid_kwargs}"
          )
          assert key in valid_kwargs, key_error_string
  
      def annotate_method(method):
          if "num_returns" in kwargs:
              method.__ray_num_returns__ = kwargs["num_returns"]
          if "concurrency_group" in kwargs:
              method.__ray_concurrency_group__ = kwargs[
                  "concurrency_group"
              ]
          return method
  
      return annotate_method
  
imports: import json
  import logging
  from concurrent.futures import Future
  from typing import TYPE_CHECKING, Any, Callable, List, Optional, Union
  from ray._private import ray_option_utils
  from ray.util.client.runtime_context import _ClientWorkerPropertyAPI
label_desc: Use image node_id 16 for calling the _ClientAPI obj's underlying member method code with example usage: obj.method() and returns: annotate_method, method