code: def test_1020_selection():
      """Test making a 10/20 selection dict."""
      pytest.importorskip("pymatreader")
      raw_fname = testing_path / "EEGLAB" / "test_raw.set"
      loc_fname = testing_path / "EEGLAB" / "test_chans.locs"
      raw = read_raw_eeglab(raw_fname, preload=True)
      montage = read_custom_montage(loc_fname)
      raw = raw.rename_channels(
          dict(zip(raw.ch_names, montage.ch_names))
      )
      raw.set_montage(montage)
  
      for input in ("a_string", 100, raw, [1, 2]):
          pytest.raises(TypeError, make_1020_channel_selections, input)
  
      sels = make_1020_channel_selections(raw.info)
      # are all frontal channels placed before all occipital channels?
      for name, picks in sels.items():
          fs = min(
              [
                  ii
                  for ii, pick in enumerate(picks)
                  if raw.ch_names[pick].startswith("F")
              ]
          )
          ps = max(
              [
                  ii
                  for ii, pick in enumerate(picks)
                  if raw.ch_names[pick].startswith("O")
              ]
          )
          assert fs > ps
  
      # are channels in the correct selection?
      fz_c3_c4 = [raw.ch_names.index(ch) for ch in ("Fz", "C3", "C4")]
      for channel, roi in zip(fz_c3_c4, ("Midline", "Left", "Right")):
          assert channel in sels[roi]
  
      # ensure returning channel names works as expected
      sels_names = make_1020_channel_selections(
          raw.info, return_ch_names=True
      )
      for selection, ch_names in sels_names.items():
          assert ch_names == [
              raw.ch_names[idx] for idx in sels[selection]
          ]
  
imports: import hashlib
  from copy import deepcopy
  from functools import partial
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from scipy.io import savemat
  from mne import Epochs, EpochsArray, EvokedArray, create_info, make_ad_hoc_cov, pick_channels, pick_types, read_events
  from mne._fiff.constants import FIFF, _ch_unit_mul_named
  from mne.channels import combine_channels, equalize_channels, find_ch_adjacency, get_builtin_ch_adjacencies, make_1020_channel_selections, read_ch_adjacency, read_custom_montage, rename_channels
  from mne.channels.channels import _BUILTIN_CHANNEL_ADJACENCIES, _BuiltinChannelAdjacency, _ch_neighbor_adjacency, _compute_ch_adjacency
  from mne.datasets import testing
  from mne.io import RawArray, read_info, read_raw_bti, read_raw_ctf, read_raw_eeglab, read_raw_fif, read_raw_kit
  from mne.parallel import parallel_func
  from mne.utils import requires_good_network
label_desc: Use image node_id 10 for calling a global function with example usage: test_1020_selection() without return types