from typing import Counter


def generate_samples(n_samples, func, *args, **kwargs):
    """Call a function a bunch of times and count the results.

    Args:
        n_samples: Number of time to call the function.
        func: The function results are counted from.
        *args
        **args: The arguments to pass to func.

    Returns:
        Counter containing results.
    """
    samples = Counter()
    for _ in range(n_samples):
        res = func(*args, **kwargs)
        samples[res] += 1
    return samples