def METHOD_NAME(args):
    exp_id = args.id
    port = args.port
    debug = args.debug
    foreground = args.foreground
    exp_dir = args.experiment_dir
    # NOTE: Backward compatibility
    config_json = get_stopped_experiment_config_json(exp_id, exp_dir)
    if config_json.get('trainingServicePlatform'):
        legacy_launcher.METHOD_NAME(args)
        exit()
    config = ExperimentConfig(**config_json)
    if type(config) != ExperimentConfig:
        _logger.error('Non-HPO experiment cannot be resumed with nnictl. Please use experiment.resume() in Python API.')
        exit(1)
    experiment = Experiment(config, id=exp_id)
    # Do not need to call `load_checkpoint()` here as there is nothing to load.
    experiment._action = 'resume'
    # Can't use experiment.resume() here because resume() will automatically run in RunMode.Background,
    # and thus the NNI manager process will be killed once the main process exits.
    experiment.start(port, debug, RunMode.Foreground if foreground else RunMode.Detach)