<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def expand_specializations(session, class_names):
 """ Checks whether any given name is not a class but a specialization. If it's a specialization, expand the list of class names with the child class names. """

    result = []
    for class_name in class_names:
        specialization = SpecializationV1.create(session, class_name)
        if specialization is None:
            result.append(class_name)
        else:
            result.extend(specialization.children)
            logging.info('Expanded specialization "%s" into the following'
                         ' classes: %s',
                         class_name, ' '.join(specialization.children))

    return result