code: def midpoint(self):
          
          midpoints = []
          for segment in self:
              if len(segment) < 2:
                  midpoints.append([])
              else:
                  midpoints.append(segment.midpoint())
          return midpoints
docs: Calculate the midpoint between locations in segments.
  
          Returns:
              list of Point: Groups of midpoint between points in segments