def _repr_pretty_(self, p: Any, cycle: bool) -> None:
        """Creates ASCII diagram for Jupyter, IPython, etc."""
        # There should never be a cycle, but just in case use the default repr.
        p.text(repr(self) if cycle else str(self))
Creates ASCII diagram for Jupyter, IPython, etc.
cirq-google/cirq_google/devices/grid_device.py