def mirror(self, axis=1, return_transform=False):
        r"""
        Return a copy of this image, mirrored/flipped about a certain axis.

        Parameters
        ----------
        axis : `int`, optional
            The axis about which to mirror the image.
        return_transform : `bool`, optional
            If ``True``, then the :map:`Transform` object that was used to
            perform the mirroring is also returned.

        Returns
        -------
        mirrored_image : ``type(self)``
            The mirrored image.
        transform : :map:`Transform`
            The transform that was used. It only applies if
            `return_transform` is ``True``.

        Raises
        ------
        ValueError
            axis cannot be negative
        ValueError
            axis={} but the image has {} dimensions
        """
        # Check axis argument
        if axis < 0:
            raise ValueError('axis cannot be negative')
        elif axis >= self.n_dims:
            raise ValueError("axis={} but the image has {} "
                             "dimensions".format(axis, self.n_dims))

        # Create transform that includes ...
        # ... flipping about the selected axis ...
        rot_matrix = np.eye(self.n_dims)
        rot_matrix[axis, axis] = -1
        # ... and translating back to the image's bbox
        tr_matrix = np.zeros(self.n_dims)
        tr_matrix[axis] = self.shape[axis] - 1

        # Create transform object
        trans = Rotation(rot_matrix, skip_checks=True).compose_before(
            Translation(tr_matrix, skip_checks=True))

        # Warp image
        return self.warp_to_shape(self.shape, trans.pseudoinverse(),
                                  warp_landmarks=True,
                                  return_transform=return_transform)
dataset/ETHPy150Open menpo/menpo/menpo/image/base.py/Image.mirror/original