def _make_elastic_range(begin, end):
    # Limit growth for huge numbers of pages.
    starting_factor = max(1, (end - begin) // 100)
    factor = _iter_factors(starting_factor)
    left_half, right_half = [], []
    left_val, right_val = begin, end
    right_val = end
    while left_val < right_val:
        left_half.append(left_val)
        right_half.append(right_val)
        next_factor = next(factor)
        left_val = begin + next_factor
        right_val = end - next_factor
    # If the trends happen to meet exactly at one point, retain it.
    if left_val == right_val:
        left_half.append(left_val)
    right_half.reverse()
    return left_half + right_half
Generate an S-curved range of pages.
dataset/ETHPy150Open frankban/django-endless-pagination/endless_pagination/utils.py/_make_elastic_range