

def get_hostname(backend=None, instance=None):
    'DEPRECATED: Returns the hostname for a backend or backend instance.\n\n  Warning: This API is deprecated and will be removed in a future\n  release. Please migrate to the Modules API as soon as possible.\n\n  Args:\n    backend: The name of the backend. If None, the current backend will be used.\n\n    instance: An optoinal instance number. If provided, the hostname will\n      represent the specific instance. If absent, the hostname will represent\n      the backend as a whole.\n\n  Raises:\n    InvalidBackendError\n    InvalidInstanceError\n\n  Returns:\n    The hostname of the backend or backend instance.\n  '
    if (hostname is None):
        backend = get_backend()
    if (not isinstance(backend, (str, unicode))):
        raise InvalidBackendError(('Invalid backend: %s' % backend))
    if (not re.match('^[a-zA-Z0-9\\-]+$', backend)):
        raise InvalidBackendError(('Invalid backend: %s' % backend))
    if (instance is not None):
        try:
            instance = int(instance)
        except ValueError:
            raise InvalidInstanceError('instance must be an integer.')
    if _is_dev2_environment():
        return _get_dev2_hostname(backend, instance)
    elif _is_dev_environment():
        return _get_dev_hostname(backend, instance)
    hostname = app_identity.get_default_version_hostname()
    if (hostname is None):
        raise DefaultHostnameError
    hostname = ('%s.%s' % (backend, hostname))
    if (instance is not None):
        hostname = ('%d.%s' % (instance, hostname))
    return hostname

dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/api/backends/backends.py get_hostname/VarMisuse@20/246 `backend`->`hostname`