code: def test_label_fill_restrict(fname):
      """Test label in fill and restrict."""
      src = read_source_spaces(src_fname)
      label = read_label(fname)
  
      # construct label from source space vertices
      label_src = label.restrict(src)
      vert_in_src = label_src.vertices
      values_in_src = label_src.values
      if fname == real_label_fname:
          # Check that we can auto-fill patch info quickly for one condition
          for s in src:
              s["nearest"] = None
          with _record_warnings():
              label_src = label_src.fill(src)
      else:
          label_src = label_src.fill(src)
      assert src[0]["nearest"] is not None
  
      # check label vertices
      vertices_status = np.isin(src[0]["nearest"], label.vertices)
      vertices_in = np.nonzero(vertices_status)[0]
      vertices_out = np.nonzero(np.logical_not(vertices_status))[0]
      assert_array_equal(label_src.vertices, vertices_in)
      assert_array_equal(
          np.isin(vertices_out, label_src.vertices), False
      )
  
      # check values
      value_idx = np.digitize(
          src[0]["nearest"][vertices_in], vert_in_src, True
      )
      assert_array_equal(label_src.values, values_in_src[value_idx])
  
      # test exception
      vertices = np.append([-1], vert_in_src)
      with pytest.raises(
          ValueError, match="does not contain all of the label"
      ):
          Label(vertices, hemi="lh").fill(src)
  
      # test filling empty label
      label = Label([], hemi="lh")
      label.fill(src)
      assert_array_equal(label.vertices, np.array([], int))
  
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 6 for calling a global function with example usage: test_label_fill_restrict(fname) without return types