def remove(self, uuid_or_id, identity=False):
        """Remove an identity from the registry.

        This method removes the unique identity associated to the given
        uuid and its related information, such as identities or enrollments.
        When <identity> is set to True, it will remove the identity (not the
        unique identity) which its id is <uuid_or_id>.

        :param uuid_or_id: identifier of the unique identity or
            identity to remove
        :param identity: when it is set to True, it will remove an identity,
            not a unique identity.  By default it is set to False.
        """
        if not uuid_or_id:
            return CMD_SUCCESS

        try:
            if not identity:
                api.delete_unique_identity(self.db, uuid_or_id)
            else:
                api.delete_identity(self.db, uuid_or_id)

            self.display('remove.tmpl',
                         uuid_or_id=uuid_or_id, identity=identity)
        except NotFoundError as e:
            self.error(str(e))
            return e.code

        return CMD_SUCCESS
Remove an identity from the registry.

        This method removes the unique identity associated to the given
        uuid and its related information, such as identities or enrollments.
        When <identity> is set to True, it will remove the identity (not the
        unique identity) which its id is <uuid_or_id>.

        :param uuid_or_id: identifier of the unique identity or
            identity to remove
        :param identity: when it is set to True, it will remove an identity,
            not a unique identity.  By default it is set to False.