def METHOD_NAME(ann_data_dir):
    if not os.path.exists(ann_data_dir):
        return None, -1
    subdirectories = list(next(os.walk(ann_data_dir))[1])
    def valid_checkpoint(step):
        ann_data_file = os.path.join(ann_data_dir, step, "new_ann_data")
        # succeed_flag_file is an empty file that indicates ann data has been generated
        succeed_flag_file = os.path.join(ann_data_dir, step, "succeed_flag_file")
        return os.path.exists(succeed_flag_file) and os.path.exists(ann_data_file)
    ann_data_steps = [int(s) for s in subdirectories if valid_checkpoint(s)]
    if len(ann_data_steps) > 0:
        latest_ann_data_file = os.path.join(ann_data_dir, str(max(ann_data_steps)), "new_ann_data")
        logger.info("Using latest ann_data_file:{}".format(latest_ann_data_file))
        return latest_ann_data_file, max(ann_data_steps)
    logger.info("no new ann_data, return (None, -1)")
    return None, -1