class_docstr: Adapter class that converts the (Segment)Pen protocol to the
  PointPen protocol.
class_docstr_tok: ["Adapter","class","that","converts","the","(","Segment",")","Pen","protocol","to","the","PointPen","protocol","."]
code: def closePath(self):
      if self.contour is None:
          raise PenError("Contour missing required initial moveTo")
      if (
          len(self.contour) > 1
          and self.contour[0][0] == self.contour[-1][0]
      ):
          self.contour[0] = self.contour[-1]
          del self.contour[-1]
      else:
          # There's an implied line at the end, replace "move" with "line"
          # for the first point
          pt, tp = self.contour[0]
          if tp == "move":
              self.contour[0] = pt, "line"
      self._flushContour()
      self.contour = None
  
imports: import math
  from typing import Any, Optional, Tuple, Dict
  from fontTools.pens.basePen import AbstractPen, PenError
  from fontTools.misc.transform import DecomposedTransform
label_desc: Use image node_id 7 for calling the SegmentToPointPen obj's underlying member method code with example usage: obj.closePath() without return types