<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def traverse_inventory(self, item_filter=None):
 """Generates market Item objects for each inventory item. :param str item_filter: See `TAG_ITEM_CLASS_` contants from .market module. """

        not self._intentory_raw and self._get_inventory_raw()

        for item in self._intentory_raw['rgDescriptions'].values():
            tags = item['tags']
            for tag in tags:
                internal_name = tag['internal_name']
                if item_filter is None or internal_name == item_filter:

                    item_type = Item
                    if internal_name == TAG_ITEM_CLASS_CARD:
                        item_type = Card

                    appid = item['market_fee_app']
                    title = item['name']

                    yield item_type(appid, title)