def stored_cookie_messages_count(storage, response):
 cookie = response.cookies.get(storage.cookie_name)
 if ((not cookie) or (cookie['max-age'] == 0)):
  return 0
 data = storage._decode(cookie.value)
 if (not data):
  return 0
 if (data[(-1)] == CookieStorage.not_finished):
  data.pop()
 return len(data)

def stored_cookie_messages_count ( storage , response ) : cookie = response . cookies . get ( storage . cookie_name ) if ( ( not cookie ) or ( cookie [ 'max-age' ] == 0 ) ) : return 0 data = storage . _decode ( cookie . value ) if ( not data ) : return 0 if ( data [ ( - 1 ) ] == CookieStorage . not_finished ) : data . pop ( ) return len ( data )
return an integer containing the number of messages stored .