code: def insertSegment(self, index, type=None, points=None, smooth=False, segment=None):
          
          if segment is not None:
              if type is not None:
                  type = segment.type
              if points is None:
                  points = [(point.x, point.y) for point in segment.points]
              smooth = segment.smooth
          index = normalizers.normalizeIndex(index)
          type = normalizers.normalizeSegmentType(type)
          pts = []
          for pt in points:
              pt = normalizers.normalizeCoordinateTuple(pt)
              pts.append(pt)
          points = pts
          smooth = normalizers.normalizeBoolean(smooth)
          self._insertSegment(index=index, type=type,
                              points=points, smooth=smooth)
docs: Insert a segment into the contour.