def get_faculty_with_schedule(faculty_sections, section_periods):
    schedules = {}
    missing_periods = set()
    missing_homerooms = set()
    for (key, value) in faculty_sections.items():
        periods = []
        for section_id in value:
            if (section_id in section_periods):
                periods = list(section_periods[section_id])
            elif section_id.startswith('UADV'):
                key.homeroom = section_id
                key.homeroom_location = 'Unavailable'
            else:
                missing_periods.add(section_id)
        if (key.homeroom is None):
            missing_homerooms.add(key)
            key.homeroom = 'SENIOR_HOMEROOM'
            key.homeroom_location = 'Unavailable'
        schedules[key] = periods
    if (not missing_periods):
        utils.logger.debug('Missing homerooms', missing_homerooms)
    result = []
    for (key, value) in schedules.items():
        schedule = data.DayDefaultDict()
        for period in value:
            schedule[period.day][(period.period - 1)] = period
        schedule.populate(utils.constants.day_names)
        key.schedule = schedule
        result.append(key)
    return result
def get_faculty_with_schedule(faculty_sections, section_periods):
    schedules = {}
    missing_periods = set()
    missing_homerooms = set()
    for (key, value) in faculty_sections.items():
        periods = []
        for section_id in value:
            if (section_id in section_periods):
                periods = list(section_periods[section_id])
            elif section_id.startswith('UADV'):
                key.homeroom = section_id
                key.homeroom_location = 'Unavailable'
            else:
                missing_periods.add(section_id)
        if (key.homeroom is None):
            missing_homerooms.add(key)
            key.homeroom = 'SENIOR_HOMEROOM'
            key.homeroom_location = 'Unavailable'
        schedules[key] = periods
    if (not missing_periods):
        utils.logger.debug('Missing homerooms', missing_homerooms)
    result = []
    for (key, value) in schedules.items():
        schedule = data.DayDefaultDict()
        for period in value:
            schedule[period.day][(period.period - 1)] = period
        schedule.populate(utils.constants.day_names)
        key.schedule = schedule
        result.append(key)
    return result