def METHOD_NAME(service: str, path: str) -> MotoDispatcher:
    url_map = get_moto_routing_table(service)
    if len(url_map._rules) == 1:
        # in most cases, there will only be one dispatch method in the list of urls, so no need to do matching
        rule = next(url_map.iter_rules())
        return rule.endpoint
    matcher = url_map.bind(config.LOCALSTACK_HOSTNAME)
    try:
        endpoint, _ = matcher.match(path_info=path)
    except NotFound as e:
        raise NotImplementedError(
            f"No moto route for service {service} on path {path} found."
        ) from e
    return endpoint