code: def convert_predictions(
      predictions: List[Dict[str, Any]]
  ) -> Tuple[Dict[str, Any], List]:
      # Flatten list if batches were used
      if all(isinstance(fl, list) for fl in predictions):
          unrolled_predictions = []
          for prediction_batch in predictions:
              unrolled_predictions.extend(prediction_batch)
          predictions = unrolled_predictions
      result = default_collate(predictions)
      inputs = result.pop(DataKeys.INPUT)
      return result, inputs
  
imports: from typing import Any, Dict, List, Tuple
  from torch.utils.data._utils.collate import default_collate
  from flash.core.data.io.input import DataKeys
label_desc: Use image node_id 1 for calling a global function with example usage: convert_predictions(predictions) and returns: result,  inputs