def sort_items(items):
    """sorts the items into a dictionary of categories, with a list of items"""

    sorted_items = {}
    for item in items:
        category = lookup(item, 'itemCategory', 'categoryCode')
        if sorted_items.get(category) is None:
            sorted_items[category] = []
        sorted_items[category].append(item)

    return sorted_items
def sort_items ( items ) : sorted_items = { } for item in items : category = lookup ( item , 'itemCategory' , 'categoryCode' ) if sorted_items . get ( category ) is None : sorted_items [ category ] = [ ] sorted_items [ category ] . append ( item ) return sorted_items
sorts the items into a dictionary of categories, with a list of items