code: def test_grow_labels():
      """Test generation of circular source labels."""
      pytest.importorskip("nibabel")
      seeds = [0, 50000]
      # these were chosen manually in mne_analyze
      should_be_in = [[49, 227], [51207, 48794]]
      hemis = [0, 1]
      names = ["aneurism", "tumor"]
      labels = grow_labels(
          "sample", seeds, 3, hemis, subjects_dir, names=names
      )
  
      tgt_names = ["aneurism-lh", "tumor-rh"]
      tgt_hemis = ["lh", "rh"]
      for label, seed, hemi, sh, name in zip(
          labels, seeds, tgt_hemis, should_be_in, tgt_names
      ):
          assert np.any(label.vertices == seed)
          assert np.all(np.isin(sh, label.vertices))
          assert_equal(label.hemi, hemi)
          assert_equal(label.name, name)
  
      # grow labels with and without overlap
      seeds = [57532, [58887, 6304]]
      l01, l02 = grow_labels(
          "fsaverage", seeds, 20, [0, 0], subjects_dir
      )
      seeds = [57532, [58887, 6304]]
      l11, l12 = grow_labels(
          "fsaverage", seeds, 20, [0, 0], subjects_dir, overlap=False
      )
  
      # test label naming
      assert_equal(l01.name, "Label_0-lh")
      assert_equal(l02.name, "Label_1-lh")
      assert_equal(l11.name, "Label_0-lh")
      assert_equal(l12.name, "Label_1-lh")
  
      # test color assignment
      l11_c, l12_c = grow_labels(
          "fsaverage",
          seeds,
          20,
          [0, 0],
          subjects_dir,
          overlap=False,
          colors=None,
      )
      assert_equal(l11_c.color, _n_colors(2)[0])
      assert_equal(l12_c.color, _n_colors(2)[1])
  
      lab_colors = np.array([[0, 0, 1, 1], [1, 0, 0, 1]])
      l11_c, l12_c = grow_labels(
          "fsaverage",
          seeds,
          20,
          [0, 0],
          subjects_dir,
          overlap=False,
          colors=lab_colors,
      )
      assert_array_equal(l11_c.color, lab_colors[0, :])
      assert_array_equal(l12_c.color, lab_colors[1, :])
  
      lab_colors = np.array([0.1, 0.2, 0.3, 0.9])
      l11_c, l12_c = grow_labels(
          "fsaverage",
          seeds,
          20,
          [0, 0],
          subjects_dir,
          overlap=False,
          colors=lab_colors,
      )
      assert_array_equal(l11_c.color, lab_colors)
      assert_array_equal(l12_c.color, lab_colors)
  
      # make sure set 1 does not overlap
      overlap = np.intersect1d(l11.vertices, l12.vertices, True)
      assert_array_equal(overlap, [])
  
      # make sure both sets cover the same vertices
      l0 = l01 + l02
      l1 = l11 + l12
      assert_array_equal(l1.vertices, l0.vertices)
  
      # non-overlapping (gh-8848)
      for overlap in (False, True):
          grow_labels(
              "fsaverage", [0], 1, 1, subjects_dir, overlap=overlap
          )
  
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 19 for calling a global function with example usage: test_grow_labels() without return types