code: def paths_to_polygons(paths, scale=None):
      
      polygons = [None] * len(paths)
      for i, path in enumerate(paths):
          if len(path) < 4:
              # since the first and last vertices are identical in
              # a closed loop a 4 vertex path is the minimum for
              # non-zero area
              continue
          try:
              polygons[i] = repair_invalid(Polygon(path), scale)
          except ValueError:
              # raised if a polygon is unrecoverable
              continue
          except BaseException:
              log.error('unrecoverable polygon', exc_info=True)
      polygons = np.array(polygons)
      return polygons
docs: Given a sequence of connected points turn them into
      valid shapely Polygon objects.
  
      Parameters
      -----------
      paths : (n,) sequence
          Of (m,2) float, closed paths
      scale: float
          Approximate scale of drawing for precision
  
      Returns
      -----------
      polys: (p,) list
          shapely.geometry.Polygon
          None