code: def _aux_hdr_info(hdr_fname):
      """Aux function for _get_hdr_info."""
      with open(hdr_fname, "rb") as f:
          # extract the first section to resemble a cfg
          header = f.readline()
          codepage = "utf-8"
          # we don't actually need to know the coding for the header line.
          # the characters in it all belong to ASCII and are thus the
          # same in Latin-1 and UTF-8
          header = header.decode("ascii", "ignore").strip()
          _check_bv_version(header, "header")
  
          settings = f.read()
          try:
              # if there is an explicit codepage set, use it
              # we pretend like it's ascii when searching for the codepage
              cp_setting = re.search(
                  "Codepage=(.+)",
                  settings.decode("ascii", "ignore"),
                  re.IGNORECASE & re.MULTILINE,
              )
              if cp_setting:
                  codepage = cp_setting.group(1).strip()
              # BrainAmp Recorder also uses ANSI codepage
              # an ANSI codepage raises a LookupError exception
              # python recognize ANSI decoding as cp1252
              if codepage == "ANSI":
                  codepage = "cp1252"
              settings = settings.decode(codepage)
          except UnicodeDecodeError:
              # if UTF-8 (new standard) or explicit codepage setting fails,
              # fallback to Latin-1, which is Windows default and implicit
              # standard in older recordings
              settings = settings.decode("latin-1")
  
      if settings.find("[Comment]") != -1:
          params, settings = settings.split("[Comment]")
      else:
          params, settings = settings, ""
      cfg = configparser.ConfigParser()
      with StringIO(params) as fid:
          cfg.read_file(fid)
  
      # get sampling info
      # Sampling interval is given in microsec
      cinfostr = "Common Infos"
      if not cfg.has_section(cinfostr):
          cinfostr = (
              "Common infos"  # NeurOne BrainVision export workaround
          )
  
      # get sampling info
      # Sampling interval is given in microsec
      sfreq = 1e6 / cfg.getfloat(cinfostr, "SamplingInterval")
      info = _empty_info(sfreq)
      info._unlocked = False
      return settings, cfg, cinfostr, info
  
imports: import configparser
  import os
  import os.path
  import re
  from datetime import datetime, timezone
  from io import StringIO
  import numpy
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _empty_info
  from ..._fiff.utils import _mult_cal_one, _read_segments_file
  from ...annotations import Annotations, read_annotations
  from ...channels import make_dig_montage
  from ...defaults import HEAD_SIZE_DEFAULT
  from ...transforms import _sph_to_cart
  from ...utils import _DefaultEventParser, fill_doc, logger, verbose, warn
  from ..base import BaseRaw
label_desc: Use image node_id 6 for calling a global function with example usage: _aux_hdr_info(hdr_fname) and returns: settings,  cfg,  cinfostr,  info