(objs: List[Any])
return paths
Iterates through the given objects and identifies all methods that serve http requests.
    A url pattern is generated for each of these methods,
    but only if no such path exists already in urlpatterns.
    Returns the list of url patterns.
Iterates through the given objects and identifies all methods that serve http requests.
    A url pattern is generated for each of these methods,
    but only if no such path exists already in urlpatterns.
    Returns the list of url patterns.
Iterates through the given objects and identifies all methods that serve http requests . A url pattern is generated for each of these methods but only if no such path exists already in urlpatterns . Returns the list of url patterns .
def get_paths(objs: List[Any]) -> List[URLPattern]:
    """Iterates through the given objects and identifies all methods that serve http requests.
    A url pattern is generated for each of these methods,
    but only if no such path exists already in urlpatterns.
    Returns the list of url patterns."""
    paths = []
    for obj in objs:
        for name, method in inspect.getmembers(obj, inspect.isfunction):
            if name == "get_state":
                # the state url is an exception
                # it cannot be named after its method name, as every page has its own get_state
                continue
            if name.startswith("_"):
                # do not expose internal methods
                continue
            # use __annotations__ instead of get_type_hints, because the latter raised errors about
            # WSGIRequest not being defined in some configurations
            # string annotations are sufficient for our use case
            type_hints = method.__annotations__
            if "request" in type_hints:
                request_type = type_hints["request"]
            elif "_request" in type_hints:
                request_type = type_hints["_request"]
            else:
                continue
            if (
                request_type == "WSGIRequest" or issubclass(request_type, WSGIRequest)
            ) and method not in urlmethods:
                name = name.replace("_", "-")
                paths.append(path(name + "/", method, name=name))
    return paths
def get_paths ( objs : List [ Any ] ) -> List [ URLPattern ] : paths = [ ] for obj in objs : for name , method in inspect . getmembers ( obj , inspect . isfunction ) : if name == "get_state" : # the state url is an exception # it cannot be named after its method name, as every page has its own get_state continue if name . startswith ( "_" ) : # do not expose internal methods continue # use __annotations__ instead of get_type_hints, because the latter raised errors about # WSGIRequest not being defined in some configurations # string annotations are sufficient for our use case type_hints = method . __annotations__ if "request" in type_hints : request_type = type_hints [ "request" ] elif "_request" in type_hints : request_type = type_hints [ "_request" ] else : continue if ( request_type == "WSGIRequest" or issubclass ( request_type , WSGIRequest ) ) and method not in urlmethods : name = name . replace ( "_" , "-" ) paths . append ( path ( name + "/" , method , name = name ) ) return paths