code: def _make_headings(contrasts, title, model):
      """Create report page title, heading & sub-heading \
      using title text or contrast names.
  
      Accepts contrasts and user supplied title string or
      contrasts and user supplied 3 element list or tuple.
  
      If title is not in (None, 'auto'),
      page title == heading,
      model type == sub-heading
  
      Parameters
      ----------
      contrasts : Dict[str, np.array or str]
          Contrast information, as a dict in the form
              {'contrast_title_1': contrast_info_1/title_1, ...}
          Contrast titles are used in page title and secondary heading
          if `title` is not 'auto' or None.
  
      title : String or List/Tuple with 3 elements
          User supplied text for HTML Page title and primary heading.
          Or 3 element List/Tuple for Title Heading, sub-heading resp.
          Overrides title auto-generation.
  
      model : FirstLevelModel or SecondLevelModel
          The model, passed in to determine its type
          to be used in page title & headings.
  
      Returns
      -------
      (HTML page title, heading, sub-heading) : Tuple[str, str, str]
          If title is user-supplied, then subheading is empty string.
  
      """
      if isinstance(model, glm.first_level.FirstLevelModel):
          model_type = "First Level Model"
      elif isinstance(model, glm.second_level.SecondLevelModel):
          model_type = "Second Level Model"
  
      if title:
          return title, title, model_type
  
      contrasts_names = sorted(list(contrasts.keys()))
      contrasts_text = ", ".join(contrasts_names)
  
      page_title = f"Report: {model_type} for {contrasts_text}"
      page_heading_1 = f"Statistical Report for {contrasts_text}"
      page_heading_2 = model_type
      return page_title, page_heading_1, page_heading_2
  
imports: import os
  import string
  import warnings
  from collections import OrderedDict
  from collections.abc import Iterable
  from html import escape
  import numpy
  import pandas
  from matplotlib import pyplot
  from nilearn.plotting import plot_glass_brain, plot_roi, plot_stat_map
  from nilearn.plotting.img_plotting import MNI152TEMPLATE
  from nilearn.plotting.matrix_plotting import plot_contrast_matrix, plot_design_matrix
  from nilearn.reporting.html_report import HTMLReport
  from .._utils import fill_doc
  from nilearn._utils import check_niimg
  from nilearn.maskers import NiftiMasker
  from nilearn.reporting.get_clusters_table import get_clusters_table
  from nilearn.reporting.utils import figure_to_svg_quoted
label_desc: Use image node_id 6 for calling a global function with example usage: _make_headings(contrasts, title, model) and returns: page_title,  page_heading_1,  page_heading_2, title,  title,  model_type