code: def test_dynamic_pipeline(shared_ray_instance):
      @ray.remote
      class Model:
          def __init__(self, arg):
              self.arg = arg
  
          def forward(self, x):
              return self.arg + str(x)
  
      @ray.remote
      class ModelSelection:
          def is_even(self, x):
              return x % 2 == 0
  
      @ray.remote
      def pipeline(x, m1, m2, selection):
          sel = selection.is_even.remote(x)
          if ray.get(sel):
              result = m1.forward.remote(x)
          else:
              result = m2.forward.remote(x)
          return ray.get(result)
  
      m1 = Model.bind("Even: ")
      m2 = Model.bind("Odd: ")
      selection = ModelSelection.bind()
  
      even_input = pipeline.bind(20, m1, m2, selection)
      print(even_input)
      assert ray.get(even_input.execute()) == "Even: 20"
  
      odd_input = pipeline.bind(21, m1, m2, selection)
      print(odd_input)
      assert ray.get(odd_input.execute()) == "Odd: 21"
  
imports: import pytest
  import ray
  from ray.dag import PARENT_CLASS_NODE_KEY, PREV_CLASS_METHOD_CALL_KEY
label_desc: Use image node_id 9 for calling a global function with example usage: test_dynamic_pipeline(shared_ray_instance) and returns: ray, unknown, unknown