code: def list_items(self, sort_key=None, reverse=False):
          
          items = list(self.items.values())
          if sort_key:
              items.sort(key=sort_key, reverse=reverse)
          return items
docs: Return a list of cart items.
  
          Parameters
          ----------
          sort_key : func
              A function to customize the list order, same as the 'key'
              argument to the built-in :func:`sorted`.
          reverse: bool
              If set to True, the sort order will be reversed.
  
          Returns
          -------
          list
              List of :attr:`item_class` instances.
  
          Examples
          --------
          >>> cart = Cart(request)
          >>> cart.list_items(lambda item: item.obj.name)
          [<CartItem: obj=bar, quantity=3>,
           <CartItem: obj=foo, quantity=1>,
           <CartItem: obj=nox, quantity=5>]
          >>> cart.list_items(lambda item: item.quantity, reverse=True)
          [<CartItem: obj=nox, quantity=5>,
           <CartItem: obj=bar, quantity=3>,
           <CartItem: obj=foo, quantity=1>]