code: def as_of(self, date):
          
          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 IndexError:
              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
docs: 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.