def as_of(self, date):
        """Get a snapshot as of a specific date.

        Returns an instance, or an iterable of the instances, of the
        original model with all the attributes set according to what
        was present on the object on the date provided.
        """
        if not self.instance:
            return self._as_of_set(date)
        queryset = self.get_queryset().filter(history_date__lte=date)
        try:
            history_obj = queryset[0]
        except __HOLE__:
            raise self.instance.DoesNotExist(
                "%s had not yet been created." %
                self.instance._meta.object_name)
        if history_obj.history_type == '-':
            raise self.instance.DoesNotExist(
                "%s had already been deleted." %
                self.instance._meta.object_name)
        return history_obj.instance
dataset/ETHPy150Open treyhunner/django-simple-history/simple_history/manager.py/HistoryManager.as_of