code: def test_args_named_and_star(ray_start_shared_local_modes):
      def hello(a, x="hello", **kwargs):
          return a, x, kwargs
  
      class TestActor:
          def hello(self, a, x="hello", **kwargs):
              return a, x, kwargs
  
      def test_function(fn, remote_fn):
          assert fn(1, x=2, y=3) == ray.get(
              remote_fn.remote(1, x=2, y=3)
          )
          assert fn(1, 2, y=3) == ray.get(remote_fn.remote(1, 2, y=3))
          assert fn(1, y=3) == ray.get(remote_fn.remote(1, y=3))
  
          assert fn(
              1,
          ) == ray.get(
              remote_fn.remote(
                  1,
              )
          )
          assert fn(1) == ray.get(remote_fn.remote(1))
  
          with pytest.raises(TypeError):
              remote_fn.remote(1, 2, x=3)
  
      remote_test_function = ray.remote(test_function)
  
      remote_hello = ray.remote(hello)
      test_function(hello, remote_hello)
      ray.get(remote_test_function.remote(hello, remote_hello))
  
      remote_actor_class = ray.remote(TestActor)
      remote_actor = remote_actor_class.remote()
      actor_method = remote_actor.hello
      local_actor = TestActor()
      local_method = local_actor.hello
      test_function(local_method, actor_method)
      ray.get(remote_test_function.remote(local_method, actor_method))
  
imports: import logging
  import os
  import pickle
  import random
  import sys
  import time
  import pytest
  import ray
  import ray.cluster_utils
  from ray._private.test_utils import SignalActor, client_test_enabled, get_error_message, run_string_as_driver
label_desc: Use image node_id 26 for calling a global function with example usage: test_args_named_and_star(ray_start_shared_local_modes) and returns: a,  x,  kwargs, a,  x,  kwargs