code: def _reshape_aggregates(named_aggregates, agg_shapes, rep, fold, run):
      """Reshape specified values of `named_aggregates` to reflect the nested repetitions/folds/runs
      structure used for other aggregated values
  
      Parameters
      ----------
      named_aggregates: Dict[str, Union[list, object]]
          Aggregated values collected by a particular aggregator-like `LambdaCallback`. Can have up to
          four keys, with expected value types parenthesized: "runs" (list), "folds" (list),
          "reps" (list), and "final" (object). This function will attempt to reshape the values of the
          "runs" and "folds" keys to reflect the nested repetitions/folds/runs structure used for
          other aggregated values
      agg_shapes: Dict[str, Tuple[int, ...]]
          Shapes of the values aggregated by aggregator-like `LambdaCallback` methods. Can have up to
          two keys: "runs", "folds". If the return value of a method is not an iterable, its shape
          will be an empty tuple
      rep: Integer
          The repetition number currently being executed
      fold: Integer
          The fold number currently being executed
      run: Integer
          The run number currently being executed
  
      Returns
      -------
      named_aggregates: Dict[str, Union[list, object]]
          Original aggregated values, with the values for keys "runs" and "folds" reshaped
  
      Examples
      --------
      >>> _input = dict(
      ...     runs=list("abcdefghijklmnopqrstuvwx"),
      ...     folds=["abc", "def", "ghi", "jkl", "mno", "pqr", "stu", "vwx"],
      ...     reps=["abcdefghijkl", "mnopqrstuvwx"],
      ...     final="foo"
      ... )
      >>> _expected = dict(
      ...     runs=[
      ...         [["a", "b", "c"], ["d", "e", "f"], ["g", "h", "i"], ["j", "k", "l"]],
      ...         [["m", "n", "o"], ["p", "q", "r"], ["s", "t", "u"], ["v", "w", "x"]],
      ...     ],
      ...     folds=[["abc", "def", "ghi", "jkl"], ["mno", "pqr", "stu", "vwx"]],
      ...     reps=["abcdefghijkl", "mnopqrstuvwx"],
      ...     final="foo",
      ... )
      >>> assert _reshape_aggregates(_input, dict(runs=tuple(), folds=tuple()), 1, 3, 2) == _expected
      """
      runs_shape = (rep + 1, fold + 1, run + 1)
  
      for key, shape in [
          ("runs", runs_shape),
          ("folds", runs_shape[:-1]),
      ]:
          if key not in named_aggregates:
              continue
          named_aggregates[key] = np.reshape(
              named_aggregates[key], shape + agg_shapes[key]
          ).tolist()
      return named_aggregates
  
imports: from hyperparameter_hunter.i_o.exceptions import DeprecatedWarning
  from hyperparameter_hunter.settings import G
  from inspect import signature
  import numpy
  from uuid import uuid4
  from warnings import warn
label_desc: Use image node_id 2 for calling a global function with example usage: _reshape_aggregates(named_aggregates, agg_shapes, rep, fold, run) and returns: named_aggregates