def find_nodes_in_packages(graph, pkg_prefixes):
    """
    Find all nodes that fall under the list of :pkg_prefixes.
    """
    nodes = set()
    for node in graph.nodes.values():
        for pkg_prefix in pkg_prefixes:
            # If we have an array, use its base type
            base_type = node.name.lstrip("[")
            if base_type.startswith(pkg_prefix):
                nodes.add(node)
    return nodes