code: def test_input_attr_partial_access(shared_ray_instance):
      @ray.remote
      class Model:
          def __init__(self, weight: int):
              self.weight = weight
  
          def forward(self, input: int):
              return self.weight * input
  
      @ray.remote
      def combine(a, b, c, d=None):
          if not d:
              return a + b + c
          else:
              return a + b + c + d["deep"]["nested"]
  
      # 1) Test default wrapping of args and kwargs into internal python object
      with InputNode() as dag_input:
          m1 = Model.bind(1)
          m2 = Model.bind(2)
          m1_output = m1.forward.bind(dag_input[0])
          m2_output = m2.forward.bind(dag_input[1])
          dag = combine.bind(
              m1_output, m2_output, dag_input.m3, dag_input.m4
          )
      # 1*1 + 2*2 + 3 + 4 = 12
      assert (
          ray.get(dag.execute(1, 2, m3=3, m4={"deep": {"nested": 4}}))
          == 12
      )
  
      # 2) Test user passed data object as only input to the dag.execute()
      class UserDataObj:
          user_object_field_0: Any
          user_object_field_1: Any
          field_3: Any
  
          def __init__(
              self,
              user_object_field_0: Any,
              user_object_field_1: Any,
              field_3: Any,
          ) -> None:
              self.user_object_field_0 = user_object_field_0
              self.user_object_field_1 = user_object_field_1
              self.field_3 = field_3
  
      with InputNode() as dag_input:
          m1 = Model.bind(1)
          m2 = Model.bind(2)
          m1_output = m1.forward.bind(dag_input.user_object_field_0)
          m2_output = m2.forward.bind(dag_input.user_object_field_1)
          dag = combine.bind(m1_output, m2_output, dag_input.field_3)
  
      # 1*1 + 2*2 + 3
      assert ray.get(dag.execute(UserDataObj(1, 2, 3))) == 8
  
      # 3) Test user passed only one list object with regular list index accessor
      with InputNode() as dag_input:
          m1 = Model.bind(1)
          m2 = Model.bind(2)
          m1_output = m1.forward.bind(dag_input[0])
          m2_output = m2.forward.bind(dag_input[1])
          dag = combine.bind(m1_output, m2_output, dag_input[2])
      # 1*1 + 2*2 + 3 + 4 = 12
      assert ray.get(dag.execute([1, 2, 3])) == 8
  
      # 4) Test user passed only one dict object with key str accessor
      with InputNode() as dag_input:
          m1 = Model.bind(1)
          m2 = Model.bind(2)
          m1_output = m1.forward.bind(dag_input["m1"])
          m2_output = m2.forward.bind(dag_input["m2"])
          dag = combine.bind(m1_output, m2_output, dag_input["m3"])
      # 1*1 + 2*2 + 3 + 4 = 12
      assert ray.get(dag.execute({"m1": 1, "m2": 2, "m3": 3})) == 8
  
      with pytest.raises(
          AssertionError,
          match="Please only use int index or str as first-level key",
      ):
          with InputNode() as dag_input:
              m1 = Model.bind(1)
              dag = m1.forward.bind(dag_input[(1, 2)])
  
file_path: ray/python/ray/dag/tests/test_input_node.py
imports: import pytest
  from ray.dag.dag_node import DAGNode
  from ray.dag.input_node import InputNode
  from typing import Any, TypeVar
  import ray
label_desc: Use image node_id 9 for calling a global function with example usage: test_input_attr_partial_access(shared_ray_instance) and returns: unknown, unknown, unknown