code: def reconstruct_output(output, metadata):
      if not metadata.need_reconstruct:
          return output
      elif isinstance(metadata, DictMetaDataInfo):
          # Single dict
          if not isinstance(output, (tuple, list)):
              output = [output]
          new_output = metadata.class_fn()
          ind_out = 0
          for idx, k in enumerate(metadata.keys):
              meta = metadata.infos[idx]
              if not meta.need_reconstruct:
                  new_output[k] = output[ind_out]
                  ind_out += 1
              else:
                  new_output[k] = MetaData.reconstruct_output(
                      output[ind_out:], meta
                  )
                  ind_out += meta.length
          return new_output
      else:
          # ListMetaDataInfo
          new_output = []
          ind_out = 0
          for index in range(metadata.length):
              meta = metadata.infos[index]
              if not meta.need_reconstruct:
                  new_output.append(output[ind_out])
                  ind_out += 1
              else:
                  # convert output based on current matadata, recursive call
                  new_output.append(
                      MetaData.reconstruct_output(
                          output[ind_out:], meta
                      )
                  )
                  ind_out += meta.length
          return new_output
  
imports: import torch
label_desc: Use image node_id 3 for calling the MetaData obj's underlying member method code with example usage: obj.reconstruct_output(output, metadata) and returns: output, new_output, new_output