code: def _read_header(fname, exclude, infer_types, include=None):
      """Unify EDF, BDF and GDF _read_header call.
  
      Parameters
      ----------
      fname : str
          Path to the EDF+, BDF, or GDF file.
      exclude : list of str | str
          Channel names to exclude. This can help when reading data with
          different sampling rates to avoid unnecessary resampling. A str is
          interpreted as a regular expression.
      infer_types : bool
          If True, try to infer channel types from channel labels. If a channel
          label starts with a known type (such as 'EEG') followed by a space and
          a name (such as 'Fp1'), the channel type will be set accordingly, and
          the channel will be renamed to the original label without the prefix.
          For unknown prefixes, the type will be 'EEG' and the name will not be
          modified. If False, do not infer types and assume all channels are of
          type 'EEG'.
      include : list of str | str
          Channel names to be included. A str is interpreted as a regular
          expression. 'exclude' must be empty if include is assigned.
  
      Returns
      -------
      (edf_info, orig_units) : tuple
      """
      ext = os.path.splitext(fname)[1][1:].lower()
      logger.info("%s file detected" % ext.upper())
      if ext in ("bdf", "edf"):
          return _read_edf_header(fname, exclude, infer_types, include)
      elif ext == "gdf":
          return _read_gdf_header(fname, exclude, include), None
      else:
          raise NotImplementedError(
              f"Only GDF, EDF, and BDF files are supported, got {ext}."
          )
  
imports: import os
  import re
  from datetime import datetime, timedelta, timezone
  import numpy
  from scipy.interpolate import interp1d
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _empty_info, _unique_channel_names
  from ..._fiff.utils import _blk_read_lims, _mult_cal_one
  from ...annotations import Annotations
  from ...filter import resample
  from ...utils import _validate_type, fill_doc, logger, verbose, warn
  from ..base import BaseRaw, _get_scaling
label_desc: Use image node_id 3 for calling a global function with example usage: _read_header(fname, exclude, infer_types, include) and returns: _read_edf_header, _read_gdf_header,  None