

def _get_dev_hostname(backend, instance=None):
    'Returns the hostname of a backend [instance] in the dev_appserver.\n\n  Args:\n    backend: The name of the backend.\n    instance: The backend instance number, in [0, instances-1].\n\n  Returns:\n    The hostname of the backend.\n  '
    port = _get_dev_port(backend, instance)
    if (not port):
        error = ('Backend not found: %s' % backend)
        if (instance is not None):
            error = ('%s.%d' % (error, instance))
        raise InvalidBackendError(error)
    host = os.environ.get('SERVER_NAME', 'localhost')
    return ('%s:%d' % (host, port))

dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/api/backends/backends.py _get_dev_hostname/original