code: def _sanitize_tri(tri):
      """Help for plot_matrix."""
      VALID_TRI_VALUES = ("full", "lower", "diag")
      if tri not in VALID_TRI_VALUES:
          raise ValueError(
              "Parameter tri needs to be one of: "
              f"{', '.join(VALID_TRI_VALUES)}."
          )
  
imports: import warnings
  import matplotlib.patches
  import matplotlib.pyplot
  import numpy
  import pandas
  from mpl_toolkits.axes_grid1 import make_axes_locatable
  from scipy.cluster.hierarchy import leaves_list, linkage, optimal_leaf_ordering
  from nilearn.glm.first_level.experimental_paradigm import check_events
  from .._utils import fill_doc
label_desc: Use image node_id 5 for calling a global function with example usage: _sanitize_tri(tri) without return types