code: def _format_error_message(response: Response) -> str:
      if isinstance(response, AmbiguousResponse):
          not_found_names: Dict = {}
          multiple_objects: List[AmbiguousFeature] = []
  
          for ambiguous_feature in response.features:
              if ambiguous_feature.total_namesake_count == 0:
                  not_found_names[ambiguous_feature.query] = None
  
              if ambiguous_feature.total_namesake_count > 0:
                  multiple_objects.append(ambiguous_feature)
  
          if len(not_found_names) > 0:
              display_limit = 10
              msg_text = "No objects were found for "
              if len(not_found_names) > display_limit:
                  msg_text += ", ".join(
                      list(not_found_names.keys())[:display_limit]
                  )
                  msg_text += " and ({}) more".format(
                      len(not_found_names) - display_limit
                  )
              else:
                  msg_text += ", ".join(list(not_found_names.keys()))
  
              return msg_text + ".\n"
  
          if len(multiple_objects) > 0:
              message = ""
              for multiple_object in multiple_objects:
                  message += (
                      _create_multiple_error_message(
                          multiple_object.query,
                          multiple_object.namesake_examples,
                          multiple_object.total_namesake_count,
                      )
                      + "\n"
                  )
  
              return message
  
          return "Invalid bad feature"
  
      if isinstance(response, ErrorResponse):
          return response.message
  
      return "Unsupported error response status: " + str(
          response.__class__
      )
  
imports: import enum
  from abc import abstractmethod
  from collections.abc import Iterable
  from typing import List, Optional, Union, Dict
  from pandas import DataFrame, Series
  from lets_plot.geo_data_internals.constants import DF_COLUMN_HIGHLIGHTS, DF_COLUMN_COUNTRY, DF_COLUMN_STATE, DF_COLUMN_COUNTY, DF_COLUMN_CITY, DF_COLUMN_ID, DF_COLUMN_FOUND_NAME, DF_COLUMN_POSITION, DF_COLUMN_LIMIT, DF_COLUMN_CENTROID
  from .gis.geocoding_service import GeocodingService
  from .gis.request import PayloadKind, RequestBuilder, RequestKind, MapRegion, RegionQuery
  from .gis.response import Answer, GeocodedFeature, Namesake, AmbiguousFeature, LevelKind
  from .gis.response import SuccessResponse, Response, AmbiguousResponse, ErrorResponse
  from .type_assertion import assert_type, assert_list_type
label_desc: Use image node_id 2 for calling a global function with example usage: _format_error_message(response) and returns: unknown, str, response, unknown, message