Add a function to get a set of sorted users from a set of uid.