code: def sort_members(tup, names):
    scalars, tuples = partition(lambda x: not is_tuple_node(tup.member[x].value), names)
    unbound, bound = partition(lambda x: tup.member[x].value.is_unbound(), scalars)
    return usorted(unbound) + usorted(bound), usorted(tuples)