code: def read_mni_template(version="a", contrast="T2"):
      """Read the MNI template from disk.
  
      Parameters
      ----------
      version: string
          There are two MNI templates 2009a and 2009c, so options available are:
          "a" and "c".
      contrast : list or string, optional
          Which of the contrast templates to read. For version "a" two contrasts
          are available: "T1" and "T2". Similarly for version "c" there are two
          options, "T1" and "mask". You can input contrast as a string or a list
  
      Returns
      -------
      list : contains the nibabel.Nifti1Image objects requested, according to the
          order they were requested in the input.
  
      Examples
      --------
      >>> # Get only the T1 file for version c:
      >>> T1 = read_mni_template("c", contrast = "T1") # doctest: +SKIP
      >>> # Get both files in this order for version a:
      >>> T1, T2 = read_mni_template(contrast = ["T1", "T2"]) # doctest: +SKIP
  
      """
      files, folder = fetch_mni_template()
      file_dict_a = {
          "T1": pjoin(folder, "mni_icbm152_t1_tal_nlin_asym_09a.nii"),
          "T2": pjoin(folder, "mni_icbm152_t2_tal_nlin_asym_09a.nii"),
      }
  
      file_dict_c = {
          "T1": pjoin(folder, "mni_icbm152_t1_tal_nlin_asym_09c.nii"),
          "mask": pjoin(
              folder, "mni_icbm152_t1_tal_nlin_asym_09c_mask.nii"
          ),
      }
  
      if contrast == "T2" and version == "c":
          raise ValueError("No T2 image for MNI template 2009c")
  
      if contrast == "mask" and version == "a":
          raise ValueError("No template mask available for MNI 2009a")
  
      if not isinstance(contrast, str) and version == "c":
          for k in contrast:
              if k == "T2":
                  raise ValueError("No T2 image for MNI template 2009c")
  
      if version == "a":
          if isinstance(contrast, str):
              return nib.load(file_dict_a[contrast])
          else:
              out_list = []
              for k in contrast:
                  out_list.append(nib.load(file_dict_a[k]))
      elif version == "c":
          if isinstance(contrast, str):
              return nib.load(file_dict_c[contrast])
          else:
              out_list = []
              for k in contrast:
                  out_list.append(nib.load(file_dict_c[k]))
      else:
          raise ValueError(
              "Only 2009a and 2009c versions are available"
          )
      return out_list
  
imports: import os
  import contextlib
  import logging
  import json
  import os.path
  from os.path import join
  from hashlib import md5
  from shutil import copyfileobj
  from tqdm.auto import tqdm
  import numpy
  import nibabel
  import tarfile
  import tempfile
  import zipfile
  from dipy.core.gradients import gradient_table, gradient_table_from_gradient_strength_bvecs
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.io.image import load_nifti, load_nifti_data, save_nifti
  from dipy.io.streamline import load_trk
  from dipy.utils.optpkg import optional_package, TripWire
  from urllib.request import urlopen
label_desc: Use image node_id 23 for calling a global function with example usage: read_mni_template(version, contrast) and returns: out_list, nib, nib