def _node_and_coordinates(
    nodes: Iterable[_GRIDLIKE_NODE],
) -> Iterable[tuple[_GRIDLIKE_NODE, tuple[int, int]]]:
    """Yield tuples whose first element is the input node and the second is guaranteed to be a tuple
    of two integers. The input node can be a tuple of ints or a GridQubit."""
    for node in nodes:
        if isinstance(node, GridQubit):
            yield node, (node.row, node.col)
        else:
            x, y = node
            yield node, (x, y)
Yield tuples whose first element is the input node and the second is guaranteed to be a tuple
    of two integers. The input node can be a tuple of ints or a GridQubit.
cirq-core/cirq/devices/named_topologies.py