class_docstr: Geocoder using the HERE Geocoder API.
  
  Documentation at:
      https://developer.here.com/documentation/geocoder/
  
  .. attention::
      This class uses a v6 API which is in maintenance mode.
      Consider using the newer :class:`.HereV7` class.
docstr: Parse a location name, latitude, and longitude from an JSON response.
docstr_tok: ["Parse","a","location","name",",","latitude",",","and","longitude","from","an","JSON","response","."]
code: def _parse_json(self, doc, exactly_one=True):
      """
      Parse a location name, latitude, and longitude from an JSON response.
      """
      status_code = doc.get("statusCode", 200)
      if status_code != 200:
          err = doc.get("errorDetails", "")
          if status_code == 401:
              raise GeocoderAuthenticationFailure(err)
          elif status_code == 403:
              raise GeocoderInsufficientPrivileges(err)
          elif status_code == 429:
              raise GeocoderRateLimited(err)
          elif status_code == 503:
              raise GeocoderUnavailable(err)
          else:
              raise GeocoderServiceError(err)
  
      try:
          resources = doc["Response"]["View"][0]["Result"]
      except IndexError:
          resources = None
      if not resources:
          return None
  
      def parse_resource(resource):
          """
          Parse each return object.
          """
          stripchars = ", \n"
          addr = resource["Location"]["Address"]
  
          address = addr.get("Label", "").strip(stripchars)
          city = addr.get("City", "").strip(stripchars)
          state = addr.get("State", "").strip(stripchars)
          zipcode = addr.get("PostalCode", "").strip(stripchars)
          country = addr.get("Country", "").strip(stripchars)
  
          city_state = join_filter(", ", [city, state])
          place = join_filter(" ", [city_state, zipcode])
          location = join_filter(", ", [address, place, country])
  
          display_pos = resource["Location"]["DisplayPosition"]
          latitude = float(display_pos["Latitude"])
          longitude = float(display_pos["Longitude"])
  
          return Location(location, (latitude, longitude), resource)
  
      if exactly_one:
          return parse_resource(resources[0])
      else:
          return [parse_resource(resource) for resource in resources]
  
imports: import collections.abc
  import json
  import warnings
  from functools import partial
  from urllib.parse import urlencode
  from geopy.adapters import AdapterHTTPError
  from geopy.exc import ConfigurationError, GeocoderAuthenticationFailure, GeocoderInsufficientPrivileges, GeocoderQueryError, GeocoderRateLimited, GeocoderServiceError, GeocoderUnavailable
  from geopy.geocoders.base import DEFAULT_SENTINEL, ERROR_CODE_MAP, Geocoder
  from geopy.location import Location
  from geopy.util import join_filter, logger
label_desc: Use image node_id 4 for calling the Here obj's underlying member method code with example usage: obj._parse_json(doc, exactly_one) and returns: None, Location, parse_resource, unknown