<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def from_soup_tag(tag):
        "Returns an instance from a given soup tag."
        periods = []
        notes = []
        for elem in tag.findAll(recursive=False):
            if elem.name not in ('period', 'note'):
                raise TypeError("Unknown tag found: " + str(elem))
            if elem.name == 'note':
                notes.append(elem.string.strip())
            elif elem.name == 'period':
                periods.append(Period.from_soup_tag(elem))
        return Section(
            tag['crn'], tag['num'], tag['students'], tag['seats'],
            periods, notes
        )