code: def resample_boundaries(polygon, resolution, clip=None):
      
      def resample_boundary(boundary):
          # add a polygon.exterior or polygon.interior to
          # the deque after resampling based on our resolution
          count = boundary.length / resolution
          count = int(np.clip(count, *clip))
          return resample_path(boundary.coords, count=count)
      if clip is None:
          clip = [8, 200]
      # create a sequence of [(n,2)] points
      kwargs = {'shell': resample_boundary(polygon.exterior),
                'holes': deque()}
      for interior in polygon.interiors:
          kwargs['holes'].append(resample_boundary(interior))
      kwargs['holes'] = np.array(kwargs['holes'])
      return kwargs
docs: Return a version of a polygon with boundaries resampled
      to a specified resolution.
  
      Parameters
      -------------
      polygon:    shapely.geometry.Polygon object
      resolution: float, desired distance between points on boundary
      clip:       (2,) int, upper and lower bounds to clip
                  number of samples to (to avoid exploding counts)
  
      Returns
      ------------
      kwargs: dict, keyword args for a Polygon(**kwargs)