def _decorate_urlconf(urlpatterns, decorator=require_auth, *args, **kwargs):

    if isinstance(urlpatterns, (list, tuple)):

        for pattern in urlpatterns:
            if getattr(pattern, 'callback', None):
                pattern._callback = decorator(
                    pattern.callback, *args, **kwargs)
            if getattr(pattern, 'url_patterns', []):
                _decorate_urlconf(
                    pattern.url_patterns, decorator, *args, **kwargs)
    else:
        if getattr(urlpatterns, 'callback', None):
            urlpatterns._callback = decorator(
                urlpatterns.callback, *args, **kwargs)

# make this method public
Decorate all urlpatterns by specified decorator
dataset/ETHPy150Open django-leonardo/django-leonardo/leonardo/decorators.py/_decorate_urlconf