code: def test_label_geometry(fname, area):
      """Test label geometric computations."""
      pytest.importorskip("nibabel")
      label = read_label(fname, subject="sample")
      got_area = label.compute_area(subjects_dir=subjects_dir)
      assert_allclose(got_area, area, rtol=1e-3)
      # using a sparse label emits a warning
      label_sparse = label.restrict(src_fname)
      assert 0 < len(label_sparse.vertices) < len(label.vertices)
      with pytest.warns(RuntimeWarning, match="No complete triangles"):
          assert (
              label_sparse.compute_area(subjects_dir=subjects_dir)
              == 0.0
          )
      dist, outside = label.distances_to_outside(
          subjects_dir=subjects_dir
      )
      rr, tris = read_surface(
          subjects_dir / "sample" / "surf" / "lh.white"
      )
      mask = np.zeros(len(rr), bool)
      mask[label.vertices] = 1
      border_mask = np.isin(label.vertices, _mesh_borders(tris, mask))
      # The distances of the border vertices is smaller than that of non-border
      lo, mi, hi = np.percentile(dist[border_mask], (0, 50, 100))
      assert 0.1e-3 < lo < 0.5e-3 < mi < 1.0e-3 < hi < 2.0e-3
      lo, mi, hi = np.percentile(dist[~border_mask], (0, 50, 100))
      assert 0.5e-3 < lo < 1.0e-3 < mi < 9.0e-3 < hi < 25e-3
      # check that the distances are close but uniformly <= than euclidean
      assert not np.isin(outside, label.vertices).any()
      border_dist = dist[border_mask]
      border_euc = 1e-3 * np.linalg.norm(
          rr[label.vertices[border_mask]] - rr[outside[border_mask]],
          axis=1,
      )
      assert_allclose(border_dist, border_euc, atol=1e-4)
      inside_dist = dist[~border_mask]
      inside_euc = 1e-3 * np.linalg.norm(
          rr[label.vertices[~border_mask]] - rr[outside[~border_mask]],
          axis=1,
      )
      assert_array_less(inside_euc, inside_dist)
      assert_array_less(0.25 * inside_dist, inside_euc)
  
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 24 for calling a global function with example usage: test_label_geometry(fname, area) without return types