def find_path(method, path):
    for pattern, handler in routes[method]:
        match = pattern.match(path)
        if match:
            return handler, match.groupdict()
    return None, {}
Given a method and a path,
dataset/ETHPy150Open heiskr/sagefy/server/framework/routes.py/find_path