def _is_valid_placement_helper(
    big_graph: nx.Graph, small_mapped: nx.Graph, small_to_big_mapping: dict
):
    """Helper function for `is_valid_placement` that assumes the mapping of `small_graph` has
    already occurred.

    This is so we don't duplicate work when checking placements during `draw_placements`.
    """
    subgraph = big_graph.subgraph(small_to_big_mapping.values())
    return (subgraph.nodes == small_mapped.nodes) and (subgraph.edges == small_mapped.edges)
Helper function for `is_valid_placement` that assumes the mapping of `small_graph` has
    already occurred.

    This is so we don't duplicate work when checking placements during `draw_placements`.
    
cirq-core/cirq/devices/named_topologies.py