<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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