def approxrand(a, b, **kwargs):
    shuffles = kwargs.get('shuffles', 999)
    # there's no point in trying to shuffle beyond all possible permutations
    shuffles = \
        min(shuffles, reduce(operator.mul, xrange(1, len(a) + len(b) + 1)))
    stat = kwargs.get('statistic', lambda lst: sum(lst) / len(lst))
    verbose = kwargs.get('verbose', False)

    if verbose:
        print('shuffles: %d' % shuffles)

    actual_stat = fabs(stat(a) - stat(b))

    if verbose:
        print('actual statistic: %f' % actual_stat)
        print('-' * 60)

    c = 1e-100
    lst = LazyConcatenation([a, b])
    indices = list(range(len(a) + len(b)))

    for i in xrange(shuffles):
        if verbose and i % 10 == 0:
            print('shuffle: %d' % i)

        shuffle(indices)

        pseudo_stat_a = stat(LazyMap(lambda i: lst[i], indices[:len(a)]))
        pseudo_stat_b = stat(LazyMap(lambda i: lst[i], indices[len(a):]))
        pseudo_stat = fabs(pseudo_stat_a - pseudo_stat_b)

        if pseudo_stat >= actual_stat:
            c += 1

        if verbose and i % 10 == 0:
            print('pseudo-statistic: %f' % pseudo_stat)
            print('significance: %f' % ((c + 1) / (i + 1)))
            print('-' * 60)

    significance = (c + 1) / (shuffles + 1)

    if verbose:
        print('significance: %f' % significance)
        if betai:
            for phi in [0.01, 0.05, 0.10, 0.15, 0.25, 0.50]:
                print("prob(phi<=%f): %f" % (phi, betai(c, shuffles, phi)))

    return (significance, c, shuffles)
Provide an empty set of command arguments to be customized in tests
dataset/ETHPy150Open nltk/nltk/nltk/metrics/scores.py/approxrand--crossover with--dataset/ETHPy150Open SUSE/azurectl/test/unit/commands_compute_endpoint_test.py/TestComputeEndpointTask.__init_command_args