

def get_backend_for_host(self, host):
    if self.service:
        return self.service
    for (backend_name, backend) in BACKENDS.items():
        for url_base in backend.url_bases:
            if re.match(url_base, ('http://%s' % host)):
                return backend_name
    raise RuntimeError(('Invalid host: "%s"' % host))

dataset/ETHPy150Open spulec/moto/moto/server.py DomainDispatcherApplication.get_backend_for_host/original