def delete_named_urlpattern(urlpatterns, name):

    found = False
    ix = 0

    while not found and ix < len(urlpatterns):
        pattern = urlpatterns[ix]
        if hasattr(pattern, 'url_patterns'):
            found = delete_named_urlpattern(pattern.url_patterns, name)
        else:
            if name and hasattr(pattern, 'name'):
                if pattern.name == name:
                    del urlpatterns[ix]
                    found = True

        if not found:
            ix += 1

    return found
Delete the named urlpattern.
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/satchmo_utils/urlhelper.py/delete_named_urlpattern