code: def _unflatten_single_dict(flat_dict):
      """Convert a flat dict of key-value pairs to dict tree.
  
      Example
      -------
  
          _unflatten_single_dict({
            foo_bar_baz: 123,
            foo_bar_biz: 456,
            x_bonks: 'hi',
          })
  
          # Returns:
          # {
          #   foo: {
          #     bar: {
          #       baz: 123,
          #       biz: 456,
          #     },
          #   },
          #   x: {
          #     bonks: 'hi'
          #   }
          # }
  
      Parameters
      ----------
      flat_dict : dict
          A one-level dict where keys are fully-qualified paths separated by
          underscores.
  
      Returns
      -------
      dict
          A tree made of dicts inside of dicts.
  
      """
      out: Dict[str, Any] = dict()
      for pathstr, v in flat_dict.items():
          path = pathstr.split("_")
  
          prev_dict: Optional[Dict[str, Any]] = None
          curr_dict = out
  
          for k in path:
              if k not in curr_dict:
                  curr_dict[k] = dict()
              prev_dict = curr_dict
              curr_dict = curr_dict[k]
  
          if prev_dict is not None:
              prev_dict[k] = v
  
      return out
  
imports: from typing import Any, Dict, Mapping, Optional
label_desc: Use image node_id 1 for calling a global function with example usage: _unflatten_single_dict(flat_dict) and returns: out