def first(self):
        """
        Returns the first object of a query, returns None if no match is found.
        """
        qs = self if self.ordered else self.order_by('pk')
        try:
            return qs[0]
        except __HOLE__:
            return None
dataset/ETHPy150Open ulule/django-courriers/courriers/core.py/QuerySet.first