def __get_auto_sample(ndim, gradient):
    """ Decode which sampling method to use

    Arguments:
    ndim: int (dimensionality)
    gradient: (None or function/true)
    Returns: sampler string
    """
    if ndim < 10:
        sample = 'unif'
    elif 10 <= ndim <= 20:
        sample = 'rwalk'
    else:
        if gradient is None:
            sample = 'rslice'
        else:
            sample = 'hslice'
    return sample