<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _to_enos_roles(roles):
 """Transform the roles to use enoslib.host.Host hosts. Args: roles (dict):
 roles returned by :py:func:`enoslib.infra.provider.Provider.init` """


    def to_host(h):
        extra = {}
        # create extra_vars for the nics
        # network_role = ethX
        for nic, roles in h["nics"]:
            for role in roles:
                extra[role] = nic

        return Host(h["host"], user="root", extra=extra)

    enos_roles = {}
    for role, hosts in roles.items():
        enos_roles[role] = [to_host(h) for h in hosts]
    logger.debug(enos_roles)
    return enos_roles