def decorate_urlpatterns(urlpatterns, decorator):
 for pattern in urlpatterns:
  if hasattr(pattern, u'url_patterns'):
   decorate_urlpatterns(pattern.url_patterns, decorator)
  if (DJANGO_VERSION < (1, 10)):
   if hasattr(pattern, u'_callback'):
    pattern._callback = update_wrapper(decorator(pattern.callback), pattern.callback)
  elif getattr(pattern, u'callback', None):
   pattern.callback = update_wrapper(decorator(pattern.callback), pattern.callback)
 return urlpatterns

def decorate_urlpatterns ( urlpatterns , decorator ) : for pattern in urlpatterns : if hasattr ( pattern , u'url_patterns' ) : decorate_urlpatterns ( pattern . url_patterns , decorator ) if ( DJANGO_VERSION < ( 1 , 10 ) ) : if hasattr ( pattern , u'_callback' ) : pattern . _callback = update_wrapper ( decorator ( pattern . callback ) , pattern . callback ) elif getattr ( pattern , u'callback' , None ) : pattern . callback = update_wrapper ( decorator ( pattern . callback ) , pattern . callback ) return urlpatterns
decorate all the views in the passed urlpatterns list with the given decorator .