@staticmethod<EOL><INDENT>def add_item(session, item, quantity=<NUM_LIT:1>):<DEDENT>
shopping_cart = session.get_attribute('<STR_LIT>')<EOL>if shopping_cart:<EOL><INDENT>shopping_cart.add_item(item, quantity)<EOL><DEDENT>else:<EOL><INDENT>shopping_cart = ShoppingCart()<EOL>shopping_cart.add_item(item, quantity)<EOL><DEDENT>session.set_attribute('<STR_LIT>', shopping_cart)<EOL>
:param item: a ShoppingCartItem namedtuple