<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_includes(include_packages, freezer=None, optional=None):
 """ Iterate the list of packages to build a complete list of those packages as well as all subpackages. :param include_packages: list of package names :type: include_pacakges: list of basestr :param freezer: The freezer to use (See FREEZER constants) :param optional: Optional pacakge names to include (will only issue a warning if they don't exist) :return: complete set of package includes """

    freezer = resolve_freezer(freezer)

    # Import (or get reference to) all listed packages to ensure that they exist.
    package_references = _import_packages(include_packages, optional=optional)

    # Find all includes for the given freezer type
    includes = freezer.build_includes(package_references)

    return includes