class_docstr: Step that reduces a dimension instead of manually looping on it.
  
  Using this step is equivalent to doing `sum(dact_data, [])` for each dact_data
  that might be a IDT, DIT, or EOT of a DACT (DAtaConTainer) to flatten the data,
  then the data is by default unflattened at the end of the loop in _did_process.
class_docstr_tok: ["Step","that","reduces","a","dimension","instead","of","manually","looping","on","it",".","Using","this","step","is","equivalent","to","doing","`","sum","(","dact_data",",","[","]",")","`","for","each","dact_data","that","might","be","a","IDT",",","DIT",",","or","EOT","of","a","DACT","(","DAtaConTainer",")","to","flatten","the","data",",","then","the","data","is","by","default","unflattened","at","the","end","of","the","loop","in","_did_process","."]
docstr: Reaugment the flattened data container back to its full original shape using lists.
code: def _did_process(self, data_container: DACT, context: CX) -> DACT:
      """
      Reaugment the flattened data container back to its full original shape using lists.
      """
      reaug_dact = super()._did_process(data_container, context).copy()
  
      if self.then_unflatten:
          if reaug_dact._ids is not None and self.spare_ids is None:
              reaug_dact.set_ids(
                  self._reaugment_list(reaug_dact._ids, self.len_ids)
              )
          else:
              reaug_dact.set_ids(self.spare_ids)
          if reaug_dact.data_inputs is not None:
              reaug_dact.set_data_inputs(
                  self._reaugment_list(
                      reaug_dact.data_inputs, self.len_di
                  )
              )
          if reaug_dact.expected_outputs is not None:
              reaug_dact.set_expected_outputs(
                  self._reaugment_list(
                      reaug_dact.expected_outputs, self.len_eo
                  )
              )
  
      self._invariant(reaug_dact, data_container)
  
      self.spare_ids = None
      self.len_ids = []
      self.len_di = []
      self.len_eo = []
  
      return reaug_dact
  
imports: import copy
  from operator import itemgetter
  from typing import Callable, List, Optional, Tuple, Union
  from neuraxle.base import CX, DACT, BaseStep, BaseTransformer, ForceHandleMixin, ForceHandleOnlyMixin, Identity, MetaStep, NamedStepsList, TruncableJoblibStepSaver
  from neuraxle.data_container import DIT, EOT, IDT, DACTData, ListDataContainer
  from neuraxle.steps.flow import ExecuteIf
  import numpy
label_desc: Use image node_id 4 for calling the FlattenForEach obj's underlying member method code with example usage: obj._did_process(data_container, context) and returns: reaug_dact