parameters: (self, response, method, format=None)
return_statement: return result
docstring: Parses the response according to the given (optional) format, which should be either 'JSON' or 'XML'.
docstring_summary: Parses the response according to the given (optional) format, which should be either 'JSON' or 'XML'.
docstring_tokens: Parses the response according to the given ( optional ) format which should be either JSON or XML .
function: def _parse_response(self, response, method, format=None):
          """Parses the response according to the given (optional) format, which should be either 'JSON' or 'XML'."""
          if not format:
              format = RESPONSE_FORMAT
  
          if format == 'JSON':
              result = simplejson.loads(response)
  
              self._check_error(result)
          elif format == 'XML':
              dom = minidom.parseString(response)
              result = self._parse_response_item(dom)
              dom.unlink()
  
              if 'error_response' in result:
                  self._check_error(result['error_response'])
  
              result = result[method[9:].replace('.', '_') + '_response']
          else:
              raise RuntimeError('Invalid format specified.')
  
          return result
function_tokens: def _parse_response ( self , response , method , format = None ) : if not format : format = RESPONSE_FORMAT if format == 'JSON' : result = simplejson . loads ( response ) self . _check_error ( result ) elif format == 'XML' : dom = minidom . parseString ( response ) result = self . _parse_response_item ( dom ) dom . unlink ( ) if 'error_response' in result : self . _check_error ( result [ 'error_response' ] ) result = result [ method [ 9 : ] . replace ( '.' , '_' ) + '_response' ] else : raise RuntimeError ( 'Invalid format specified.' ) return result