code: def interpolate_points_by_max_distance(
      points, max_distance, closed=True
  ):
      """Interpolate points with distance ``d`` on a line string.
  
      For a list of points ``A, B, C``, if the distance between ``A`` and ``B``
      is greater than `max_distance`, it will place at least one point between
      ``A`` and ``B`` at ``A + max_distance * (B - A)``. Multiple points can
      be placed between the two points if they are far enough away from each
      other. The process is repeated for ``B`` and ``C``.
  
      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.
  
      max_distance : number
          Maximum distance between any two points in the result.
  
      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 interpolated points added to the
          iterable. If `closed` is ``False``, the last point in `points` is not
          returned.
  
      """
      assert (
          max_distance > 0
      ), "Expected max_distance to have a value >0, got %.8f." % (
          max_distance,
      )
      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:]):
          dist = np.sqrt(
              (point_a[0] - point_b[0]) ** 2
              + (point_a[1] - point_b[1]) ** 2
          )
          nb_steps = int((dist / max_distance) - 1)
          points_interp.extend(
              [point_a]
              + interpolate_point_pair(point_a, point_b, nb_steps)
          )
      if not closed:
          points_interp.append(points[-1])
      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 10 for calling a global function with example usage: interpolate_points_by_max_distance(points, max_distance, closed) and returns: points_interp, points