def get_descriptor_defaults(self, api_info, hostname=None):
hostname = (hostname or endpoints_util.get_app_hostname() or<EOL>api_info.hostname)<EOL>protocol = '<STR_LIT:http>' if ((hostname and hostname.startswith('<STR_LIT:localhost>')) or<EOL>endpoints_util.is_running_on_devserver()) else '<STR_LIT>'<EOL>base_path = api_info.base_path.strip('<STR_LIT:/>')<EOL>defaults = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:root>': '<STR_LIT>'.format(protocol, hostname, base_path),<EOL>'<STR_LIT:name>': api_info.name,<EOL>'<STR_LIT:version>': api_info.api_version,<EOL>'<STR_LIT>': api_info.api_version,<EOL>'<STR_LIT>': api_info.path_version,<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': False,<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>'.format(protocol, hostname, base_path),<EOL>'<STR_LIT:type>': '<STR_LIT>',<EOL>'<STR_LIT>': <NUM_LIT><EOL>}<EOL>}<EOL>if api_info.canonical_name:<EOL><INDENT>defaults['<STR_LIT>'] = api_info.canonical_name<EOL><DEDENT>if api_info.owner_domain:<EOL><INDENT>defaults['<STR_LIT>'] = api_info.owner_domain<EOL><DEDENT>if api_info.owner_name:<EOL><INDENT>defaults['<STR_LIT>'] = api_info.owner_name<EOL><DEDENT>if api_info.package_path:<EOL><INDENT>defaults['<STR_LIT>'] = api_info.package_path<EOL><DEDENT>if api_info.title:<EOL><INDENT>defaults['<STR_LIT:title>'] = api_info.title<EOL><DEDENT>if api_info.documentation:<EOL><INDENT>defaults['<STR_LIT>'] = api_info.documentation<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.