code: def test_morph():
      """Test inter-subject label morphing."""
      pytest.importorskip("nibabel")
      label_orig = read_label(real_label_fname)
      label_orig.subject = "sample"
      # should work for specifying vertices for both hemis, or just the
      # hemi of the given label
      vals = list()
      for grade in [
          5,
          [np.arange(10242), np.arange(10242)],
          np.arange(10242),
      ]:
          label = label_orig.copy()
          # this should throw an error because the label has all zero values
          pytest.raises(ValueError, label.morph, "sample", "fsaverage")
          label.values.fill(1)
          label = label.morph(
              None, "fsaverage", 5, grade, subjects_dir, 1
          )
          label = label.morph(
              "fsaverage", "sample", 5, None, subjects_dir, 2
          )
          assert np.isin(label_orig.vertices, label.vertices).all()
          assert len(label.vertices) < 3 * len(label_orig.vertices)
          vals.append(label.vertices)
      assert_array_equal(vals[0], vals[1])
      # make sure label smoothing can run
      assert_equal(label.subject, "sample")
      verts = [np.arange(10242), np.arange(10242)]
      for hemi in ["lh", "rh"]:
          label.hemi = hemi
          with _record_warnings():  # morph map maybe missing
              label.morph(None, "fsaverage", 5, verts, subjects_dir, 2)
      pytest.raises(
          TypeError, label.morph, None, 1, 5, verts, subjects_dir, 2
      )
      pytest.raises(
          TypeError,
          label.morph,
          None,
          "fsaverage",
          5.5,
          verts,
          subjects_dir,
          2,
      )
      with _record_warnings():  # morph map maybe missing
          label.smooth(subjects_dir=subjects_dir)
  
imports: import glob
  import os
  import pickle
  import shutil
  from itertools import product
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_array_less, assert_equal
  from scipy import sparse
  from mne import grow_labels, labels_to_stc, morph_labels, random_parcellation, read_label, read_labels_from_annot, read_source_estimate, read_source_spaces, read_surface, spatial_tris_adjacency, split_label, stc_to_label, write_labels_to_annot
  from mne.datasets import testing
  from mne.label import Label, _blend_colors, _load_vert_pos, _n_colors, _read_annot, _read_annot_cands, label_sign_flip, select_sources
  from mne.source_estimate import mesh_edges
  from mne.source_space import SourceSpaces
  from mne.surface import _mesh_borders
  from mne.utils import _record_warnings, get_subjects_dir
label_desc: Use image node_id 18 for calling a global function with example usage: test_morph() without return types