def __get_walks_slices(walks0, slices0, sample, ndim):
    """
    Get the best number of steps for random walk/slicing based on
    the type of sampler and dimension

    Arguments:
    walks0: integer (provided by user or none for auto)
    slices0: integer (provided by user or none for auto)
    sample: string (sampler type)
    ndim: int (dimensionality)
    Returns the tuple with number of walk steps, number of slice steps
    """
    walks, slices = None, None
    # see https://github.com/joshspeagle/dynesty/issues/289
    if sample in ['hslice', 'rslice']:
        slices = 3 + ndim
    elif sample == 'slice':
        slices = 3
        # we don't add dimensions, since we loop over them
    elif sample == 'rwalk':
        # this is technically incorrect a we need to add ndim **2
        walks = 20 + ndim
    slices = slices0 or slices
    walks = walks0 or walks
    return walks, slices