python/ray/experimental/dag/dag_node.py
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)

        return replaced_inputs

        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.
        
Apply a given function to DAGNodes in source_input_list, and return
the replaced inputs without mutating or coping any DAGNode.
Apply a given function to DAGNodes in source_input_list and return the replaced inputs without mutating or coping any DAGNode .
def apply_functional(
        self,
        source_input_list: Any,
        predictate_fn: Callable,
        apply_fn: Callable,
    ):
        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)
        return replaced_inputs
def apply_functional ( self , source_input_list : Any , predictate_fn : Callable , apply_fn : Callable , ) : 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 ) return replaced_inputs
Apply a given function to DAGNodes in source_input_list, and return
the replaced inputs without mutating or coping any DAGNode.
Apply a given function to DAGNodes in source_input_list and return the replaced inputs without mutating or coping any DAGNode .
"""
        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.
        """
Outputs of apply_fn on DAGNodes in
source_input_list that passes predictate_fn.
Outputs of apply_fn on DAGNodes in source_input_list that passes predictate_fn .
replaced_inputs
self
source_input_list
Any
Source inputs to extract and apply function on
all children DAGNode instances.
Source inputs to extract and apply function on all children DAGNode instances .
predictate_fn
Callable
Applied on each DAGNode instance found and determine
if we should apply function to it. Can be used to filter node
types.
Applied on each DAGNode instance found and determine if we should apply function to it . Can be used to filter node types .
apply_fn
Callable
Function to appy on the node on bound attributes.
Function to appy on the node on bound attributes .