<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def first_interval_ending(self, end: datetime.datetime) \ -> Optional[Interval]: """ Returns our first interval that ends with the ``end`` parameter, or ``None``. """

        for i in self.intervals:
            if i.end == end:
                return i
        return None