def METHOD_NAME(self, runner):
    if runner.mode == 'train':
        if 'time' in runner.log_buffer.output:
            mode = 'train'
        else:
            mode = 'val'
    elif runner.mode == 'val':
        mode = 'val'
    else:
        raise ValueError(f"runner mode should be 'train' or 'val', "
                         f'but got {runner.mode}')
    return mode