code: def _get_event_parser(event_type):
      if event_type == 1:
          event_maker = CNTEventType1
          struct_pattern = "<HBcl"
      elif event_type == 2:
          event_maker = CNTEventType2
          struct_pattern = "<HBclhhfccc"
      elif event_type == 3:
          event_maker = CNTEventType3
          struct_pattern = "<HBclhhfccc"  # Same as event type 2
      else:
          raise ValueError("unknown CNT even type %s" % event_type)
  
      def parser(buffer):
          struct = Struct(struct_pattern)
          for chunk in struct.iter_unpack(buffer):
              yield event_maker(*chunk)
  
      return parser
  
file_path: mne-python/mne/io/cnt/_utils.py
imports: from collections import namedtuple
  from datetime import datetime
  from math import modf
  from os import SEEK_END
  from struct import Struct
  import numpy
  from ...utils import warn
label_desc: Use image node_id 2 for calling a global function with example usage: _get_event_parser(event_type) and returns: parser