class_docstr: Geocoder using the MapQuest API based on Licensed data.
  
  Documentation at:
      https://developer.mapquest.com/documentation/geocoding-api/
  
  MapQuest provides two Geocoding APIs:
  
  - :class:`geopy.geocoders.OpenMapQuest` Nominatim-alike API
    which is based on Open data from OpenStreetMap.
  - :class:`geopy.geocoders.MapQuest` (this class) MapQuest's own API
    which is based on Licensed data.
class_docstr_tok: ["Geocoder","using","the","MapQuest","API","based","on","Licensed","data",".","Documentation","at",":","https",":","\/\/developer.mapquest.com\/documentation\/geocoding-api\/","MapQuest","provides","two","Geocoding","APIs",":","-",":","class",":","`","geopy.geocoders.OpenMapQuest","`","Nominatim-alike","API","which","is","based","on","Open","data","from","OpenStreetMap",".","-",":","class",":","`","geopy.geocoders.MapQuest","`","(","this","class",")","MapQuest","'s","own","API","which","is","based","on","Licensed","data","."]
docstr: Returns location, (latitude, longitude) from json feed.
docstr_tok: ["Returns","location",",","(","latitude",",","longitude",")","from","json","feed","."]
code: def _parse_json(self, json, exactly_one=True):
      """Returns location, (latitude, longitude) from json feed."""
      features = json["results"][0]["locations"]
  
      if features == []:
          return None
  
      def parse_location(feature):
          addr_keys = [
              "street",
              "adminArea6",
              "adminArea5",
              "adminArea4",
              "adminArea3",
              "adminArea2",
              "adminArea1",
              "postalCode",
          ]
  
          location = [feature[k] for k in addr_keys if feature.get(k)]
          return ", ".join(location)
  
      def parse_feature(feature):
          location = parse_location(feature)
          longitude = feature["latLng"]["lng"]
          latitude = feature["latLng"]["lat"]
          return Location(location, (latitude, longitude), feature)
  
      if exactly_one:
          return parse_feature(features[0])
      else:
          return [parse_feature(feature) for feature in features]
  
file_path: geopy/geopy/geocoders/mapquest.py
imports: from functools import partial
  from urllib.parse import urlencode
  from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
  from geopy.location import Location
  from geopy.util import logger
label_desc: Use image node_id 2 for calling the MapQuest obj's underlying member method code with example usage: obj._parse_json(json, exactly_one) and returns: None, str, Location, parse_feature, unknown