code: def create_label_map(applies_to_matrix_dimension):
      maps = []
      for name, meta, label in labels:
          label_table = ci.Cifti2LabelTable()
          for key, (tag, rgba) in label.items():
              label_table[key] = ci.Cifti2Label(key, tag, *rgba)
          maps.append(
              ci.Cifti2NamedMap(
                  name, ci.Cifti2MetaData(meta), label_table
              )
          )
      return ci.Cifti2MatrixIndicesMap(
          applies_to_matrix_dimension,
          "CIFTI_INDEX_TYPE_LABELS",
          maps=maps,
      )
  
imports: import numpy
  import pytest
  import nibabel
  from nibabel import cifti2
  from nibabel.tmpdirs import InTemporaryDirectory
  from ...testing import assert_array_equal, clear_and_catch_warnings, error_warnings, suppress_warnings
label_desc: Use image node_id 7 for calling a global function with example usage: create_label_map(applies_to_matrix_dimension) and returns: ci