Conver Python set to NUMA nodemask.

def set_to_numa_nodemask(mask):
    """
    Conver Python set to NUMA nodemask.
    """
    result = nodemask_t()
    __nodemask_zero(result)

    for i in range(0, get_max_node() + 1):
        if i in mask:
            __nodemask_set(result, i)

    return result