def _match_request(http_request, stored_request):
 if ((http_request.uri.host is not None) and (http_request.uri.host != stored_request.uri.host)):
  return False
 elif (http_request.uri.path != stored_request.uri.path):
  return False
 elif (http_request.method != stored_request.method):
  return False
 elif (('gsessionid' in http_request.uri.query) or ('gsessionid' in stored_request.uri.query)):
  if ('gsessionid' not in stored_request.uri.query):
   return False
  elif ('gsessionid' not in http_request.uri.query):
   return False
  elif (http_request.uri.query['gsessionid'] != stored_request.uri.query['gsessionid']):
   return False
 return True

def _match_request ( http_request , stored_request ) : if ( ( http_request . uri . host is not None ) and ( http_request . uri . host != stored_request . uri . host ) ) : return False elif ( http_request . uri . path != stored_request . uri . path ) : return False elif ( http_request . method != stored_request . method ) : return False elif ( ( 'gsessionid' in http_request . uri . query ) or ( 'gsessionid' in stored_request . uri . query ) ) : if ( 'gsessionid' not in stored_request . uri . query ) : return False elif ( 'gsessionid' not in http_request . uri . query ) : return False elif ( http_request . uri . query [ 'gsessionid' ] != stored_request . uri . query [ 'gsessionid' ] ) : return False return True
determines whether a request is similar enough to a stored request to cause the stored response to be returned .