original_docstring: Parses an object in the form returned by lookup to a human-readable string.
docstring: Parses an object in the form returned by lookup to a human-readable string.
docstring_tokens: Parses an object in the form returned by lookup to a human - readable string .
code: def as_string(self, r):
          "Parses an object in the form returned by lookup to a human-readable string."
          if 'http_status_code' in r:
              if r['http_status_code'] == 404: return "unknown"
              if r['http_status_code'] == 403:
                  return "geolocation API rate limit exceeded."
          res = ""
          if 'city' in r and r['city'] != "": res += r['city'] + ", "
          if 'region_name' in r and r['region_name'] != "":
              res += r['region_name'] + ", "
          if 'country_name' in r and r['country_name'] != "":
              res += r['country_name'] + " "
          if 'ip' in r and r['ip'] != "": res += "(" + r['ip'] + " )"
          if res == "":
              return "Invalid response from the freegeoip.net API. The response was: " + str(
                  r)
          else:
              return res
code_tokens: def as_string ( self , r ) : if 'http_status_code' in r : if r [ 'http_status_code' ] == 404 : return "unknown" if r [ 'http_status_code' ] == 403 : return "geolocation API rate limit exceeded." res = "" if 'city' in r and r [ 'city' ] != "" : res += r [ 'city' ] + ", " if 'region_name' in r and r [ 'region_name' ] != "" : res += r [ 'region_name' ] + ", " if 'country_name' in r and r [ 'country_name' ] != "" : res += r [ 'country_name' ] + " " if 'ip' in r and r [ 'ip' ] != "" : res += "(" + r [ 'ip' ] + " )" if res == "" : return "Invalid response from the freegeoip.net API. The response was: " + str ( r ) else : return res
short_docstring: Parses an object in the form returned by lookup to a human-readable string.
short_docstring_tokens: Parses an object in the form returned by lookup to a human - readable string .
comment: "Parses an object in the form returned by lookup to a human-readable string."