code: def intersection(self, other):
          
          relative_position = self.relative_position_of(other)
          if relative_position in [
              self.RELATIVE_POSITION_PP_C,
              self.RELATIVE_POSITION_PI_LC,
              self.RELATIVE_POSITION_PI_LG,
              self.RELATIVE_POSITION_PI_CG,
              self.RELATIVE_POSITION_IP_B,
              self.RELATIVE_POSITION_II_LB,
          ]:
              return TimeInterval(begin=self.begin, end=self.begin)
          if relative_position in [
              self.RELATIVE_POSITION_IP_E,
              self.RELATIVE_POSITION_II_EG,
          ]:
              return TimeInterval(begin=self.end, end=self.end)
          if relative_position in [
              self.RELATIVE_POSITION_II_BI,
              self.RELATIVE_POSITION_II_BE,
              self.RELATIVE_POSITION_II_II,
              self.RELATIVE_POSITION_II_IE,
          ]:
              return TimeInterval(begin=other.begin, end=other.end)
          if relative_position in [
              self.RELATIVE_POSITION_IP_I,
              self.RELATIVE_POSITION_II_LI,
              self.RELATIVE_POSITION_II_LE,
              self.RELATIVE_POSITION_II_LG,
              self.RELATIVE_POSITION_II_BG,
              self.RELATIVE_POSITION_II_IG,
          ]:
              begin = max(self.begin, other.begin)
              end = min(self.end, other.end)
              return TimeInterval(begin=begin, end=end)
          return None
docs: Return the intersection between this time interval
          and the given time interval, or
          ``None`` if the two intervals do not overlap.
  
          :rtype: :class:`~aeneas.exacttiming.TimeInterval` or ``NoneType``