def flip(self):
        """Flip the direction of data flow.

        Returns
        -------
        :class:`Flow`
            :attr:`In` if called as :py:`Out.flip()`; :attr:`Out` if called as :py:`In.flip()`.
        """
        if self == Out:
            return In
        if self == In:
            return Out
        assert False # :nocov:
Flip the direction of data flow.

        Returns
        -------
        :class:`Flow`
            :attr:`In` if called as :py:`Out.flip()`; :attr:`Out` if called as :py:`In.flip()`.
        
amaranth/lib/wiring.py