code: def __is_json_error(self, status, headers):
      
      content_header = headers.get('content-type', '')
      content_type, unused_params = cgi.parse_header(content_header)
      return (status.startswith('400') and
              content_type.lower() in _ALL_JSON_CONTENT_TYPES)
docs: Determine if response is an error.
  
      Args:
        status: HTTP status code.
        headers: Dictionary of (lowercase) header name to value.
  
      Returns:
        True if the response was an error, else False.