code: def get_location (host):
      
      if geoip is None:
          # no geoip available
          return None
      try:
          record = get_geoip_record(host)
      except (geoip_error, socket.error):
          log.debug(LOG_PLUGIN, "Geoip error for %r", host, exception=True)
          # ignore lookup errors
          return None
      value = u""
      if record and record.get("city"):
          value += unicode_safe(record["city"])
      if record and record.get("country_name"):
          if value:
              value += u", "
          value += unicode_safe(record["country_name"])
      return value
docs: Get translated country and optional city name.
  
      @return: country with optional city or an boolean False if not found