code: def _check_event_id(event_id, events):
      """Check event_id and convert to default format."""
      # check out event_id dict
      if event_id is None:  # convert to int to make typing-checks happy
          event_id = list(np.unique(events[:, 2]))
      if isinstance(event_id, dict):
          for key in event_id.keys():
              _validate_type(key, str, "Event names")
          event_id = {
              key: _ensure_int(val, "event_id[%s]" % key)
              for key, val in event_id.items()
          }
      elif isinstance(event_id, list):
          event_id = [
              _ensure_int(v, "event_id[%s]" % vi)
              for vi, v in enumerate(event_id)
          ]
          event_id = dict(zip((str(i) for i in event_id), event_id))
      else:
          event_id = _ensure_int(event_id, "event_id")
          event_id = {str(event_id): event_id}
      return event_id
  
imports: import numbers
  import operator
  import os
  import re
  from builtins import input
  from difflib import get_close_matches
  from importlib import import_module
  from pathlib import Path
  import numpy
  from ..defaults import HEAD_SIZE_DEFAULT, _handle_default
  from ..fixes import _compare_version, _median_complex
  from ._logging import _record_warnings, _verbose_safe_false, logger, verbose, warn
label_desc: Use image node_id 11 for calling a global function with example usage: _check_event_id(event_id, events) and returns: event_id