chrome/test/webapps/graph_analysis.py
def trim_graph_to_platform_actions(root_node: ActionNode,
                                   platform: TestPlatform) -> None:
    """
    Removes any nodes and actions from the graph that are not supported by the
    given platform.
    """
    new_children = {}
    for child in root_node.children.values():
        if child.action.supported_for_platform(platform):
            new_children[child.action.name] = child
    root_node.children = new_children
    new_state_check_actions = {}
    for action in root_node.state_check_actions.values():
        if action.supported_for_platform(platform):
            new_state_check_actions[action.name] = action
    root_node.state_check_actions = new_state_check_actions
    for child in root_node.children.values():
        trim_graph_to_platform_actions(child, platform)

    Removes any nodes and actions from the graph that are not supported by the
    given platform.
    
Removes any nodes and actions from the graph that are not supported by the
given platform.
Removes any nodes and actions from the graph that are not supported by the given platform .
def trim_graph_to_platform_actions(root_node: ActionNode,
                                   platform: TestPlatform) -> None:
    new_children = {}
    for child in root_node.children.values():
        if child.action.supported_for_platform(platform):
            new_children[child.action.name] = child
    root_node.children = new_children
    new_state_check_actions = {}
    for action in root_node.state_check_actions.values():
        if action.supported_for_platform(platform):
            new_state_check_actions[action.name] = action
    root_node.state_check_actions = new_state_check_actions
    for child in root_node.children.values():
        trim_graph_to_platform_actions(child, platform)
def trim_graph_to_platform_actions ( root_node : ActionNode , platform : TestPlatform ) -> None : new_children = { } for child in root_node . children . values ( ) : if child . action . supported_for_platform ( platform ) : new_children [ child . action . name ] = child root_node . children = new_children new_state_check_actions = { } for action in root_node . state_check_actions . values ( ) : if action . supported_for_platform ( platform ) : new_state_check_actions [ action . name ] = action root_node . state_check_actions = new_state_check_actions for child in root_node . children . values ( ) : trim_graph_to_platform_actions ( child , platform )
Removes any nodes and actions from the graph that are not supported by the
given platform.
Removes any nodes and actions from the graph that are not supported by the given platform .
"""
    Removes any nodes and actions from the graph that are not supported by the
    given platform.
    """
root_node
ActionNode
platform
TestPlatform