def parse_file() -> dict:
    """Parse into a dict of containing_bag -> List[bags]"""
    bags = {}
    with open('input.txt') as f:
        for row in f.readlines():
            # remove trailing period with [:-1]
            bag, insides_str = row.strip()[:-1].replace(' bags', '').replace(' bag', '').split(' contain ')

            # [2:] removes bag count, we don't need it -- we just need the presence of a containing bag
            # we also don't want 'no other'
            insides = [b.strip()[2:] for b in insides_str.strip().split(', ') if b.strip() != 'no other']

            if len(insides) > 0:
                bags[bag.strip()] = insides
    return bags