def cancel_single(experiment_id: int, should_have_trial: bool=False) -> None:
    cancel_experiment(experiment_id)
    trials = experiment_trials(experiment_id)
    if (should_have_trial or (len(trials) > 0)):
        assert (len(trials) == 1)
        trial = trials[0]
        assert (trial['state'] == 'CANCELED')
def cancel_single(experiment_id: int, should_have_trial: bool=False) -> None:
    cancel_experiment(experiment_id)
    trials = experiment_trials(experiment_id)
    if (should_have_trial or (len(trials) > 0)):
        assert (len(trials) == 1)
        trial = trials[0]
        assert (trial['state'] == 'CANCELED')