def _persisted_last_epoch(self) -> int:
epoch_number = <NUM_LIT:0><EOL>self._make_sure_dir_exists()<EOL>for x in os.listdir(self.model_config.checkpoint_dir()):<EOL><INDENT>match = re.match('<STR_LIT>', x)<EOL>if match:<EOL><INDENT>idx = int(match[<NUM_LIT:1>])<EOL>if idx > epoch_number:<EOL><INDENT>epoch_number = idx<EOL><DEDENT><DEDENT><DEDENT>return epoch_number<EOL>
Return number of last epoch already calculated