code: def overlap_size(self, begin, end=None):
          
          overlaps = self.overlaps(begin, end)
          if not overlaps:
              return 0
  
          if end is not None:
              # case end is given
              i0 = max(self.begin, begin)
              i1 = min(self.end, end)
              return i1 - i0
          # assume the type is interval, in other cases, an exception will be thrown
          i0 = max(self.begin, begin.begin)
          i1 = min(self.end, begin.end)
          return i1 - i0
docs: Return the overlap size between two intervals or a point
          :param begin: beginning point of the range, or the point, or an Interval
          :param end: end point of the range. Optional if not testing ranges.
          :return: Return the overlap size, None if not overlap is found
          :rtype: depends on the given input (e.g., int will be returned for int interval and timedelta for
          datetime intervals)