code: def _check_bv_version(header, kind):
      """Check the header version."""
      _data_err = """\
      MNE-Python currently only supports %s versions 1.0 and 2.0, got unparsable\
       %r. Contact MNE-Python developers for support."""
      # optional space, optional Core or V-Amp, optional Exchange,
      # Version/Header, optional comma, 1/2
      _data_re = (
          r"Brain ?Vision( Core| V-Amp)? Data( Exchange)? "
          r"%s File,? Version %s\.0"
      )
  
      assert kind in ("header", "marker")
  
      if header == "":
          warn(f"Missing header in {kind} file.")
      for version in range(1, 3):
          this_re = _data_re % (kind.capitalize(), version)
          if re.search(this_re, header) is not None:
              return version
      else:
          warn(_data_err % (kind, header))
  
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 4 for calling a global function with example usage: _check_bv_version(header, kind) and returns: version