class_docstr: Abstract class for a node in a Ray task graph.
  
  A node has a type (e.g., FunctionNode), data (e.g., function options and
  body), arguments (Python values, DAGNodes, and DAGNodes nested within Python
  argument values) and options (Ray API .options() used for function, class
  or class method)
docstr: Apply a given function to DAGNodes in source_input_list, and return
  the replaced inputs without mutating or coping any DAGNode.
  
  Args:
      source_input_list: Source inputs to extract and apply function on
          all children DAGNode instances.
      predictate_fn: Applied on each DAGNode instance found and determine
          if we should apply function to it. Can be used to filter node
          types.
      apply_fn: Function to appy on the node on bound attributes. Example:
          apply_fn = lambda node: node._get_serve_deployment_handle(
              node._deployment, node._bound_other_args_to_resolve
          )
  
  Returns:
      replaced_inputs: Outputs of apply_fn on DAGNodes in
          source_input_list that passes predictate_fn.
docstr_tok: ["Apply","a","given","function","to","DAGNodes","in","source_input_list",",","and","return","the","replaced","inputs","without","mutating","or","coping","any","DAGNode",".","Args",":","source_input_list",":","Source","inputs","to","extract","and","apply","function","on","all","children","DAGNode","instances",".","predictate_fn",":","Applied","on","each","DAGNode","instance","found","and","determine","if","we","should","apply","function","to","it",".","Can","be","used","to","filter","node","types",".","apply_fn",":","Function","to","appy","on","the","node","on","bound","attributes",".","Example",":","apply_fn","=","lambda","node",":","node._get_serve_deployment_handle","(","node._deployment",",","node._bound_other_args_to_resolve",")","Returns",":","replaced_inputs",":","Outputs","of","apply_fn","on","DAGNodes","in","source_input_list","that","passes","predictate_fn","."]
code: def apply_functional(
      self,
      source_input_list: Any,
      predictate_fn: Callable,
      apply_fn: Callable,
  ):
      """
      Apply a given function to DAGNodes in source_input_list, and return
      the replaced inputs without mutating or coping any DAGNode.
  
      Args:
          source_input_list: Source inputs to extract and apply function on
              all children DAGNode instances.
          predictate_fn: Applied on each DAGNode instance found and determine
              if we should apply function to it. Can be used to filter node
              types.
          apply_fn: Function to appy on the node on bound attributes. Example:
              apply_fn = lambda node: node._get_serve_deployment_handle(
                  node._deployment, node._bound_other_args_to_resolve
              )
  
      Returns:
          replaced_inputs: Outputs of apply_fn on DAGNodes in
              source_input_list that passes predictate_fn.
      """
      replace_table = {}
      scanner = _PyObjScanner()
      for node in scanner.find_nodes(source_input_list):
          if predictate_fn(node) and node not in replace_table:
              replace_table[node] = apply_fn(node)
  
      replaced_inputs = scanner.replace_nodes(replace_table)
      scanner.clear()
  
      return replaced_inputs
  
imports: import ray
  from ray.dag.base import DAGNodeBase
  from ray.dag.py_obj_scanner import _PyObjScanner
  from ray.util.annotations import DeveloperAPI
  from typing import Optional, Union, List, Tuple, Dict, Any, TypeVar, Callable
  import uuid
  import asyncio
  from ray.dag.compiled_dag_node import build_compiled_dag_from_ray_dag
label_desc: Use image node_id 14 for calling the DAGNode obj's underlying member method code with example usage: obj.apply_functional(source_input_list, predictate_fn, apply_fn) and returns: replaced_inputs