def get_descriptor_defaults(self, api_info, hostname=None, x_google_api_name=False):
hostname = (hostname or util.get_app_hostname() or<EOL>api_info.hostname)<EOL>protocol = '<STR_LIT:http>' if ((hostname and hostname.startswith('<STR_LIT:localhost>')) or<EOL>util.is_running_on_devserver()) else '<STR_LIT>'<EOL>base_path = api_info.base_path<EOL>if base_path != '<STR_LIT:/>':<EOL><INDENT>base_path = base_path.rstrip('<STR_LIT:/>')<EOL><DEDENT>defaults = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:info>': {<EOL>'<STR_LIT:version>': api_info.api_version,<EOL>'<STR_LIT:title>': api_info.name<EOL>},<EOL>'<STR_LIT:host>': hostname,<EOL>'<STR_LIT>': ['<STR_LIT:application/json>'],<EOL>'<STR_LIT:produces>': ['<STR_LIT:application/json>'],<EOL>'<STR_LIT>': [protocol],<EOL>'<STR_LIT>': base_path,<EOL>}<EOL>if x_google_api_name:<EOL><INDENT>defaults['<STR_LIT>'] = _validate_api_name(api_info.name)<EOL><DEDENT>return defaults<EOL>
Gets a default configuration for a service.

        Args:
          api_info: _ApiInfo object for this service.
          hostname: string, Hostname of the API, to override the value set on the
            current service. Defaults to None.

        Returns:
          A dictionary with the default configuration.