code: def plot_flow(vec, ax=None, flow_mag_range=None):
      import matplotlib  # pylint: disable=import-outside-toplevel
  
      if ax is None:
          _, ax = get_image_plot(vec.shape[1], vec.shape[0])
      direction = (np.arctan2(vec[:, :, 0], vec[:, :, 1]) + np.pi) / (
          2 * np.pi
      )
      norm = np.linalg.norm(vec, axis=-1)
      if flow_mag_range is None:
          flow_mag_range = norm.min(), norm.max()
      magnitude = np.clip(
          (norm - flow_mag_range[0])
          / (flow_mag_range[1] - flow_mag_range[0]),
          0.0,
          1.0,
      )
      saturation = np.ones_like(direction)
      hsv = np.stack([direction, saturation, magnitude], axis=-1)
      rgb = matplotlib.colors.hsv_to_rgb(hsv)
      ax.imshow(rgb, interpolation="nearest")
  
file_path: kubric/kubric/plotting.py
imports: import colorsys
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: plot_flow(vec, ax, flow_mag_range) without return types