def remove(self, elem):
        """Remove a requirement.

        :param elem: a string or :class:`Requirement` instance.
        """
        if isinstance(elem, text_type):
            for requirement in self:
                if requirement.package == elem:
                    return super(Requirements, self).remove(requirement)
        return super(Requirements, self).remove(elem)
def is_commit_id_equal(cls, dest, name):
        """
        Return whether the current commit hash equals the given name.

        Args:
          dest: the repository directory.
          name: a string name.
        """
        if not name:
            # Then avoid an unnecessary subprocess call.
            return False

        return cls.get_revision(dest) == name