def patterns(prefix, *args):
    pattern_list = []
    for t in args:
        if isinstance(t, (list, tuple)):
            t = url(prefix=prefix, *t)
        elif isinstance(t, RegexURLPattern):
            t.add_prefix(prefix)
        pattern_list.append(t)
    return pattern_list
As patterns() in django.
dataset/ETHPy150Open mjtamlyn/django-cbvpatterns/cbvpatterns.py/patterns