class_docstr: Yandex geocoder.
  
  Documentation at:
      https://tech.yandex.com/maps/doc/geocoder/desc/concepts/input_params-docpage/
class_docstr_tok: ["Yandex","geocoder",".","Documentation","at",":","https",":","\/\/tech.yandex.com\/maps\/doc\/geocoder\/desc\/concepts\/input_params-docpage\/"]
docstr: Parse JSON response body.
docstr_tok: ["Parse","JSON","response","body","."]
code: def _parse_json(self, doc, exactly_one):
      """
      Parse JSON response body.
      """
      if doc.get("error"):
          raise GeocoderServiceError(doc["error"]["message"])
  
      try:
          places = doc["response"]["GeoObjectCollection"][
              "featureMember"
          ]
      except KeyError:
          raise GeocoderParseError("Failed to parse server response")
  
      def parse_code(place):
          """
          Parse each record.
          """
          try:
              place = place["GeoObject"]
          except KeyError:
              raise GeocoderParseError(
                  "Failed to parse server response"
              )
  
          longitude, latitude = (
              float(_) for _ in place["Point"]["pos"].split(" ")
          )
  
          name_elements = ["name", "description"]
          location = ", ".join(
              [place[k] for k in name_elements if place.get(k)]
          )
  
          return Location(location, (latitude, longitude), place)
  
      if exactly_one:
          try:
              return parse_code(places[0])
          except IndexError:
              return None
      else:
          return [parse_code(place) for place in places]
  
file_path: geopy/geopy/geocoders/yandex.py
imports: from functools import partial
  from urllib.parse import urlencode
  from geopy.exc import GeocoderParseError, GeocoderServiceError
  from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
  from geopy.location import Location
  from geopy.util import logger
label_desc: Use image node_id 4 for calling the Yandex obj's underlying member method code with example usage: obj._parse_json(doc, exactly_one) and returns: Location, unknown, parse_code, None