code: def _count_points_by_type(dig):
      """Get the number of points of each type."""
      occurrences = Counter([d["kind"] for d in dig])
      return dict(
          fid=occurrences[FIFF.FIFFV_POINT_CARDINAL],
          hpi=occurrences[FIFF.FIFFV_POINT_HPI],
          eeg=occurrences[FIFF.FIFFV_POINT_EEG],
          extra=occurrences[FIFF.FIFFV_POINT_EXTRA],
      )
  
imports: import heapq
  from collections import Counter
  import numpy
  from ..utils import Bunch, _check_fname, _validate_type, logger, verbose, warn
  from .constants import FIFF, _coord_frame_named
  from .tag import read_tag
  from .tree import dir_tree_find
  from .write import start_and_end_file, write_dig_points
label_desc: Use image node_id 3 for calling a global function with example usage: _count_points_by_type(dig) and returns: dict