def parse_bags(bag_restrictions: list) -> list:
    """Parse the list of raw bag restrictions given by the input file

    :param bag_restrictions: List of raw bag restrictions
    :return: Parsed bag restrictions
    """
    parsed_restrictions = []
    for line in bag_restrictions:
        parent_str, children_str = line.split(' contain ')
        parent_str = parent_str[:-5]
        children_list = children_str.split(', ')
        children_list = [child.split(' bag')[0] for child in children_list]
        if children_list[0] == 'no other':
            children_list = []
        else:
            children_list = [child.split(' ', maxsplit=1)
                             for child in children_list]
        parsed_restrictions.append((parent_str, children_list))
    return parsed_restrictions