code: def test_actor_options_complicated(shared_ray_instance):
      """Test a more complicated setup where we apply .options() in both
      constructor and method call with overlapping keys, and ensure end to end
      options correctness.
      """
  
      @ray.remote
      def combine(x, y):
          return x + y
  
      a1 = Actor.options(name="a1_v0").bind(10)
      res = a1.get.options(name="v1").bind()
      print(res)
      assert ray.get(res.execute()) == 10
      assert a1.get_options().get("name") == "a1_v0"
      assert res.get_options().get("name") == "v1"
  
      a1 = Actor.options(name="a1_v1").bind(10)  # Cannot
      a2 = Actor.options(name="a2_v0").bind(10)
      a1.inc.options(name="v1").bind(2)
      a1.inc.options(name="v2").bind(4)
      a2.inc.options(name="v3").bind(6)
      dag = combine.options(name="v4").bind(
          a1.get.bind(), a2.get.bind()
      )
  
      print(dag)
      assert ray.get(dag.execute()) == 32
      test_a1 = dag.get_args()[0]  # call graph for a1.get.bind()
      test_a2 = dag.get_args()[1]  # call graph for a2.get.bind()
      assert test_a2.get_options() == {}  # No .options() at outer call
      # refer to a2 constructor .options() call
      assert (
          test_a2.get_other_args_to_resolve()[PARENT_CLASS_NODE_KEY]
          .get_options()
          .get("name")
          == "a2_v0"
      )
      # refer to actor method a2.inc.options() call
      assert (
          test_a2.get_other_args_to_resolve()[
              PREV_CLASS_METHOD_CALL_KEY
          ]
          .get_options()
          .get("name")
          == "v3"
      )
      # refer to a1 constructor .options() call
      assert (
          test_a1.get_other_args_to_resolve()[PARENT_CLASS_NODE_KEY]
          .get_options()
          .get("name")
          == "a1_v1"
      )
      # refer to latest actor method a1.inc.options() call
      assert (
          test_a1.get_other_args_to_resolve()[
              PREV_CLASS_METHOD_CALL_KEY
          ]
          .get_options()
          .get("name")
          == "v2"
      )
      # refer to first bound actor method a1.inc.options() call
      assert (
          test_a1.get_other_args_to_resolve()[
              PREV_CLASS_METHOD_CALL_KEY
          ]
          .get_other_args_to_resolve()[PREV_CLASS_METHOD_CALL_KEY]
          .get_options()
          .get("name")
          == "v1"
      )
  
imports: import pytest
  import ray
  from ray.dag import PARENT_CLASS_NODE_KEY, PREV_CLASS_METHOD_CALL_KEY
label_desc: Use image node_id 7 for calling a global function with example usage: test_actor_options_complicated(shared_ray_instance) and returns: unknown