def postprocess_full(self, predictions,
                       is_rir):
    """Inverts predicted reversible IRs to programs and postprocesses them."""
    predictions_postprocessed = []
    for prediction in predictions:
      try:
        if is_rir:
          prediction_orig = self.f_reversible_inverse(prediction)
        else:
          prediction_orig = prediction
        prediction_postprocessed = self.postprocess_program(prediction_orig)
      except ValueError:
        # Postprocessing can fail when the prediction has a wrong syntax.
        print("Wrong prediction syntax : {}".format(prediction))
        prediction_postprocessed = None
      predictions_postprocessed.append(prediction_postprocessed)
    return predictions_postprocessed
Inverts predicted reversible IRs to programs and postprocesses them.
language/compir/dataset_parsers/dataset_parser.py