code: def coords_3d_to_2d(coords_3d, direction, return_direction=False):
      """Project 3d coordinates into 2d ones given the direction of a cut."""
      index = _get_index_from_direction(direction)
      dimensions = [0, 1, 2]
      dimensions.pop(index)
      if return_direction:
          return coords_3d[:, dimensions], coords_3d[:, index]
      return coords_3d[:, dimensions]
  
imports: import numbers
  import matplotlib.pyplot
  import numpy
  from matplotlib.colors import Normalize
  from matplotlib.font_manager import FontProperties
  from matplotlib.lines import Line2D
  from matplotlib.patches import FancyArrow
  from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
  from nilearn._utils.docs import fill_doc
  from nilearn.image import coord_transform
  from nilearn.plotting.glass_brain import plot_brain_schematics
label_desc: Use image node_id 2 for calling a global function with example usage: coords_3d_to_2d(coords_3d, direction, return_direction) and returns: coords_3d, coords_3d,  coords_3d