code: def _pack_struct(seg_out, dict_keys=None):
      if dict_keys is not None:
          return dict(zip(dict_keys, seg_out))
      if isinstance(seg_out, (list, tuple)) and len(seg_out) == 1:
          return seg_out[0]
      return ensure_tuple(seg_out)
  
file_path: MONAI/monai/inferers/utils.py
imports: from __future__ import annotations
  import itertools
  from collections.abc import Callable, Mapping, Sequence
  from typing import Any, Iterable
  import numpy
  import torch
  import torch.nn.functional
  from monai.data.meta_tensor import MetaTensor
  from monai.data.utils import compute_importance_map, dense_patch_slices, get_valid_patch_size
  from monai.utils import BlendMode, PytorchPadMode, convert_data_type, convert_to_dst_type, ensure_tuple, ensure_tuple_rep, fall_back_tuple, look_up_option, optional_import, pytorch_after
label_desc: Use image node_id 6 for calling a global function with example usage: _pack_struct(seg_out, dict_keys) and returns: ensure_tuple, dict, seg_out