def randstr(length=32):

    if not isinstance(length, int):
        raise ValueError

    if length < 1:
        return ''

    invalid_chars_re = re.compile(r'[\'"\\]*')

    chars = string.digits + string.letters + string.punctuation
    chars = ''.join(invalid_chars_re.split(chars))

    return ''.join(random.choice(chars) for _ in range(length))
Returns a Page object for the given 1-based page number.
dataset/ETHPy150Open tooxie/shiva-server/shiva/utils.py/randstr--crossover with--dataset/ETHPy150Open amarandon/smeuhsocial/apps/pagination/paginator.py/FinitePaginator.page