def _build_sub_nics(all_nics):
    """
    Aggregate all sub nics into their sub groups.
    I.E. All nic\.X.\.*\.Y nics go into a list where all Y's are the same.

    :param all_nics: All nics to consider.
    :type all_nics: list
    """
    sub_nics = {}
    for nic in all_nics['nics']:
        possible_sub_nic = get_nic_sub_number.match(nic.key)
        if not possible_sub_nic:
            log("System {0} and NIC {1} not in valid format. "
                "Skipping.".format(nic.system, nic.key), DEBUG)
            continue
        sub_nic_number = possible_sub_nic.group(1)
        if sub_nic_number in sub_nics:
            sub_nics[sub_nic_number].append(nic)
        else:
            sub_nics[sub_nic_number] = [nic]
    return sub_nics
dataset/ETHPy150Open mozilla/inventory/migrate_dns/build_nics.py/_build_sub_nics/original