def METHOD_NAME(candidates, choice_num=1, replace=False, softmax_temperature=1):
    choice_num = min(choice_num, len(candidates))
    confidences = [cand[1] for cand in candidates]
    choice_probs = softmax(confidences, softmax_temperature)
    one_dim_candidates = np.array(candidates)
    one_dim_indices = np.arange(len(one_dim_candidates))
    sampled_one_dim_indices = np.random.choice(one_dim_indices, choice_num, replace=replace, p=choice_probs)
    sampled_candidates = one_dim_candidates[sampled_one_dim_indices]
    return sampled_candidates.tolist()