code: def _loc_to_eeg_loc(loc):
      """Convert a loc to an EEG loc."""
      if not np.isfinite(loc[:3]).all():
          raise RuntimeError("Missing EEG channel location")
      if np.isfinite(loc[3:6]).all() and (loc[3:6]).any():
          return np.array([loc[0:3], loc[3:6]]).T
      else:
          return loc[0:3][:, np.newaxis].copy()
  
imports: import html
  import re
  import struct
  from dataclasses import dataclass
  from functools import partial
  from typing import Any
  import numpy
  from scipy.sparse import csc_matrix, csr_matrix
  from ..utils import _check_option, warn
  from ..utils.numerics import _julian_to_cal
  from .constants import FIFF, _ch_coil_type_named, _ch_kind_named, _ch_unit_mul_named, _ch_unit_named, _dig_cardinal_named, _dig_kind_named
label_desc: Use image node_id 4 for calling a global function with example usage: _loc_to_eeg_loc(loc) and returns: np, loc