code: def _read_one(fid, node):
      """Read all interesting stuff for one forward solution."""
      # This function assumes the fid is open as a context manager
      if node is None:
          return None
  
      one = Forward()
      one["source_ori"] = _get_tag_int(
          fid,
          node,
          "Source orientation",
          FIFF.FIFF_MNE_SOURCE_ORIENTATION,
      )
      one["coord_frame"] = _get_tag_int(
          fid, node, "Coordinate frame", FIFF.FIFF_MNE_COORD_FRAME
      )
      one["nsource"] = _get_tag_int(
          fid,
          node,
          "Number of sources",
          FIFF.FIFF_MNE_SOURCE_SPACE_NPOINTS,
      )
      one["nchan"] = _get_tag_int(
          fid, node, "Number of channels", FIFF.FIFF_NCHAN
      )
      try:
          one["sol"] = _read_named_matrix(
              fid, node, FIFF.FIFF_MNE_FORWARD_SOLUTION, transpose=True
          )
          one["_orig_sol"] = one["sol"]["data"].copy()
      except Exception:
          logger.error("Forward solution data not found")
          raise
  
      try:
          fwd_type = FIFF.FIFF_MNE_FORWARD_SOLUTION_GRAD
          one["sol_grad"] = _read_named_matrix(
              fid, node, fwd_type, transpose=True
          )
          one["_orig_sol_grad"] = one["sol_grad"]["data"].copy()
      except Exception:
          one["sol_grad"] = None
  
      if one["sol"]["data"].shape[0] != one["nchan"] or (
          one["sol"]["data"].shape[1] != one["nsource"]
          and one["sol"]["data"].shape[1] != 3 * one["nsource"]
      ):
          raise ValueError(
              "Forward solution matrix has wrong dimensions"
          )
  
      if one["sol_grad"] is not None:
          if one["sol_grad"]["data"].shape[0] != one["nchan"] or (
              one["sol_grad"]["data"].shape[1] != 3 * one["nsource"]
              and one["sol_grad"]["data"].shape[1]
              != 3 * 3 * one["nsource"]
          ):
              raise ValueError(
                  "Forward solution gradient matrix has "
                  "wrong dimensions"
              )
  
      return one
  
imports: import os
  import re
  import shutil
  import tempfile
  from copy import deepcopy
  from os import PathLike
  from os import path
  from pathlib import Path
  from time import time
  import numpy
  from scipy import sparse
  from .._fiff.constants import FIFF
  from .._fiff.matrix import _read_named_matrix, _transpose_named_matrix, write_named_matrix
  from .._fiff.meas_info import Info, _make_ch_names_mapping, _read_bad_channels, _read_extended_ch_info, _write_bad_channels, _write_ch_infos, write_info
  from .._fiff.open import fiff_open
  from .._fiff.pick import pick_channels, pick_channels_forward, pick_info, pick_types
  from .._fiff.tag import find_tag, read_tag
  from .._fiff.tree import dir_tree_find
  from .._fiff.write import end_block, start_and_end_file, start_block, write_coord_trans, write_id, write_int, write_string
  from ..epochs import BaseEpochs
  from ..evoked import Evoked, EvokedArray
  from ..html_templates import _get_html_template
  from ..io import BaseRaw, RawArray
  from ..label import Label
  from ..source_estimate import _BaseSourceEstimate, _BaseVectorSourceEstimate
  from ..source_space._source_space import _get_src_nn, _read_source_spaces_from_tree, _set_source_space_vertices, _src_kind_dict, _write_source_spaces_to_fid, find_source_space_hemi
  from ..surface import _normal_orth
  from ..transforms import invert_transform, transform_surface_to, write_trans
  from ..utils import _check_compensation_grade, _check_fname, _check_option, _check_stc_units, _import_h5io_funcs, _on_missing, _stamp_to_dt, _validate_type, check_fname, fill_doc, get_subjects_dir, has_mne_c, logger, repr_html, run_subprocess, verbose, warn
label_desc: Use image node_id 3 for calling a global function with example usage: _read_one(fid, node) and returns: one, None