code: def test_fetch_parcellations(tmp_path):
      """Test fetching parcellations."""
      pytest.importorskip("nibabel")
      this_subjects_dir = str(tmp_path)
      os.mkdir(op.join(this_subjects_dir, "fsaverage"))
      os.mkdir(op.join(this_subjects_dir, "fsaverage", "label"))
      os.mkdir(op.join(this_subjects_dir, "fsaverage", "surf"))
      for hemi in ("lh", "rh"):
          shutil.copyfile(
              op.join(
                  subjects_dir, "fsaverage", "surf", "%s.white" % hemi
              ),
              op.join(
                  this_subjects_dir,
                  "fsaverage",
                  "surf",
                  "%s.white" % hemi,
              ),
          )
      # speed up by prenteding we have one of them
      with open(
          op.join(
              this_subjects_dir,
              "fsaverage",
              "label",
              "lh.aparc_sub.annot",
          ),
          "wb",
      ):
          pass
      datasets.fetch_aparc_sub_parcellation(
          subjects_dir=this_subjects_dir
      )
      with ArgvSetter(("--accept-hcpmmp-license",)):
          datasets.fetch_hcp_mmp_parcellation(
              subjects_dir=this_subjects_dir
          )
      for hemi in ("lh", "rh"):
          assert op.isfile(
              op.join(
                  this_subjects_dir,
                  "fsaverage",
                  "label",
                  "%s.aparc_sub.annot" % hemi,
              )
          )
      # test our annot round-trips here
      kwargs = dict(
          subject="fsaverage",
          hemi="both",
          sort=False,
          subjects_dir=this_subjects_dir,
      )
      labels = read_labels_from_annot(parc="HCPMMP1", **kwargs)
      write_labels_to_annot(
          labels,
          parc="HCPMMP1_round",
          table_name="./left.fsaverage164.label.gii",
          **kwargs,
      )
      orig = op.join(
          this_subjects_dir, "fsaverage", "label", "lh.HCPMMP1.annot"
      )
      first = hashfunc(orig)
      new = orig[:-6] + "_round.annot"
      second = hashfunc(new)
      assert first == second
  
imports: import os
  import re
  import shutil
  import zipfile
  from functools import partial
  from os import path
  import pooch
  import pytest
  from mne import datasets, read_labels_from_annot, write_labels_to_annot
  from mne.datasets import fetch_dataset, fetch_infant_template, fetch_phantom, testing
  from mne.datasets._fsaverage.base import _set_montage_coreg_path
  from mne.datasets._infant import base
  from mne.datasets._phantom import base
  from mne.datasets.utils import _manifest_check_download
  from mne.utils import ArgvSetter, _pl, catch_logging, get_subjects_dir, hashfunc, requires_good_network, use_log_level
label_desc: Use image node_id 3 for calling a global function with example usage: test_fetch_parcellations(tmp_path) without return types