code: def interpolate_points(points, nb_steps, closed=True):
      """Interpolate ``N`` on each line segment in a line string.
  
      Parameters
      ----------
      points : iterable of iterable of number
          Points on the line segments, each one given as ``(x,y)`` coordinates.
          They are assumed to form one connected line string.
  
      nb_steps : int
          Number of points to interpolate on each individual line string.
  
      closed : bool, optional
          If ``True`` the output contains the last point in `points`.
          Otherwise it does not (but it will contain the interpolated points
          leading to the last point).
  
      Returns
      -------
      list of tuple of number
          Coordinates of `points`, with additional `nb_steps` new points
          interpolated between each point pair. If `closed` is ``False``,
          the last point in `points` is not returned.
  
      """
      if len(points) <= 1:
          return points
      if closed:
          points = list(points) + [points[0]]
      points_interp = []
      for point_a, point_b in zip(points[:-1], points[1:]):
          points_interp.extend(
              [point_a]
              + interpolate_point_pair(point_a, point_b, nb_steps)
          )
      if not closed:
          points_interp.append(points[-1])
      # close does not have to be reverted here, as last point is not included
      # in the extend()
      return points_interp
  
file_path: imgaug/imgaug/augmentables/utils.py
imports: from __future__ import print_function, division, absolute_import
  import copy
  import numpy
  import six.moves
  import imgaug
label_desc: Use image node_id 9 for calling a global function with example usage: interpolate_points(points, nb_steps, closed) and returns: points_interp, points