def METHOD_NAME(base, url_patterns):
    for url in url_patterns:
        cleaned = base + url.pattern.regex.pattern.lstrip("^").rstrip("$")
        if hasattr(url, "url_patterns"):
            METHOD_NAME(cleaned, url.url_patterns)
        elif not endpoint_prefixes or cleaned.startswith(endpoint_prefixes):
            results.append((cleaned, url))