code: def _make_dig_points(
      nasion=None,
      lpa=None,
      rpa=None,
      hpi=None,
      extra_points=None,
      dig_ch_pos=None,
      *,
      coord_frame="head",
      add_missing_fiducials=False,
  ):
      """Construct digitizer info for the info.
  
      Parameters
      ----------
      nasion : array-like | numpy.ndarray, shape (3,) | None
          Point designated as the nasion point.
      lpa : array-like |  numpy.ndarray, shape (3,) | None
          Point designated as the left auricular point.
      rpa : array-like |  numpy.ndarray, shape (3,) | None
          Point designated as the right auricular point.
      hpi : array-like | numpy.ndarray, shape (n_points, 3) | None
          Points designated as head position indicator points.
      extra_points : array-like | numpy.ndarray, shape (n_points, 3)
          Points designed as the headshape points.
      dig_ch_pos : dict
          Dict of EEG channel positions.
      coord_frame : str
          The coordinate frame of the points. Usually this is "unknown"
          for native digitizer space. Defaults to "head".
      add_missing_fiducials : bool
          If True, add fiducials to the dig points if they are not present.
          Requires that coord_frame='head' and that lpa, nasion, and rpa are all
          None.
  
      Returns
      -------
      dig : list of dicts
          A container of DigPoints to be added to the info['dig'].
      """
      coord_frame = _coord_frame_const(coord_frame)
  
      dig = []
      if lpa is not None:
          lpa = np.asarray(lpa)
          if lpa.shape != (3,):
              raise ValueError(
                  f"LPA should have the shape (3,) instead of {lpa.shape}"
              )
          dig.append(
              {
                  "r": lpa,
                  "ident": FIFF.FIFFV_POINT_LPA,
                  "kind": FIFF.FIFFV_POINT_CARDINAL,
                  "coord_frame": coord_frame,
              }
          )
      if nasion is not None:
          nasion = np.asarray(nasion)
          if nasion.shape != (3,):
              raise ValueError(
                  f"Nasion should have the shape (3,) instead of {nasion.shape}"
              )
          dig.append(
              {
                  "r": nasion,
                  "ident": FIFF.FIFFV_POINT_NASION,
                  "kind": FIFF.FIFFV_POINT_CARDINAL,
                  "coord_frame": coord_frame,
              }
          )
      if rpa is not None:
          rpa = np.asarray(rpa)
          if rpa.shape != (3,):
              raise ValueError(
                  f"RPA should have the shape (3,) instead of {rpa.shape}"
              )
          dig.append(
              {
                  "r": rpa,
                  "ident": FIFF.FIFFV_POINT_RPA,
                  "kind": FIFF.FIFFV_POINT_CARDINAL,
                  "coord_frame": coord_frame,
              }
          )
      if hpi is not None:
          hpi = np.asarray(hpi)
          if hpi.ndim != 2 or hpi.shape[1] != 3:
              raise ValueError(
                  f"HPI should have the shape (n_points, 3) instead of {hpi.shape}"
              )
          for idx, point in enumerate(hpi):
              dig.append(
                  {
                      "r": point,
                      "ident": idx + 1,
                      "kind": FIFF.FIFFV_POINT_HPI,
                      "coord_frame": coord_frame,
                  }
              )
      if extra_points is not None:
          extra_points = np.asarray(extra_points)
          if len(extra_points) and extra_points.shape[1] != 3:
              raise ValueError(
                  "Points should have the shape (n_points, 3) instead of "
                  f"{extra_points.shape}"
              )
          for idx, point in enumerate(extra_points):
              dig.append(
                  {
                      "r": point,
                      "ident": idx + 1,
                      "kind": FIFF.FIFFV_POINT_EXTRA,
                      "coord_frame": coord_frame,
                  }
              )
      if dig_ch_pos is not None:
          idents = []
          use_arange = False
          for key, value in dig_ch_pos.items():
              _validate_type(key, str, "dig_ch_pos")
              try:
                  idents.append(int(key[-3:]))
              except ValueError:
                  use_arange = True
              _validate_type(
                  value, (np.ndarray, list, tuple), "dig_ch_pos"
              )
              value = np.array(value, dtype=float)
              dig_ch_pos[key] = value
              if value.shape != (3,):
                  raise RuntimeError(
                      "The position should be a 1D array of 3 floats. "
                      f"Provided shape {value.shape}."
                  )
          if use_arange:
              idents = np.arange(1, len(dig_ch_pos) + 1)
          for key, ident in zip(dig_ch_pos, idents):
              dig.append(
                  {
                      "r": dig_ch_pos[key],
                      "ident": int(ident),
                      "kind": FIFF.FIFFV_POINT_EEG,
                      "coord_frame": coord_frame,
                  }
              )
      if add_missing_fiducials:
          assert coord_frame == FIFF.FIFFV_COORD_HEAD
          # These being none is really an assumption that if you have one you
          # should have all three. But we can relax this later if necessary.
          assert lpa is None
          assert rpa is None
          assert nasion is None
          _ensure_fiducials_head(dig)
  
      return _format_dig_points(dig)
  
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 10 for calling a global function with example usage: _make_dig_points(nasion, lpa, rpa, hpi, extra_points, dig_ch_pos) and returns: _format_dig_points