Return two pairs of members, scalar and tuple members.

  The scalars will be sorted s.t. the unbound members are at the top.
352313
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)
264758
def as_tuple(self):
        
        ptr = self._pointer
        return (ptr.xx, ptr.yx, ptr.xy, ptr.yy, ptr.x0, ptr.y0)
1146511
def bracketedList(l, r, sep, expr, allow_missing_close=False):
  
  # We may need to backtrack for lists, because of list comprehension, but not for
  # any of the other lists
  strict = l != '['
  closer = sym(r) if not allow_missing_close else p.Optional(sym(r))
  if strict:
    return sym(l) - listMembers(sep, expr) - closer
  else:
    return sym(l) + listMembers(sep, expr) + closer
174344
def n_members(self):
        
        if self.is_finite:
            return int(self.max - self.min + 1)
        else:
            return np.inf
219177
def joined_seq(seq, sep=None):
    
    """
    joined_seq = tuple(seq)
    if isinstance(sep, basestring):
        joined_seq = sep.join(str(item) for item in joined_seq)
    return joined_seq
56405
def scalar(value):
    
    if isinstance(value, (list, tuple)) and len(value) == 1:
        return value[0]
    return value
1374704
def union(self):
        
        usegs = reduce(operator.or_, self.values())
        usegs.name = ' | '.join(self.keys())
        return usegs
224244
public List<Type> union(List<Type> cl1, List<Type> cl2, BiPredicate<Type, Type> shouldSkip) {
        if (cl1.isEmpty()) {
            return cl2;
        } else if (cl2.isEmpty()) {
            return cl1;
        } else if (shouldSkip.test(cl1.head, cl2.head)) {
            return union(cl1.tail, cl2.tail, shouldSkip).prepend(cl1.head);
        } else if (cl1.head.tsym.precedes(cl2.head.tsym, this)) {
            return union(cl1.tail, cl2, shouldSkip).prepend(cl1.head);
        } else if (cl2.head.tsym.precedes(cl1.head.tsym, this)) {
            return union(cl1, cl2.tail, shouldSkip).prepend(cl2.head);
        } else {
            // unrelated types
            return union(cl1.tail, cl2, shouldSkip).prepend(cl1.head);
        }
    }
119920
public final Tuple2<Tuple1<T1>, Tuple3<T2, T3, T4>> split1() {
        return new Tuple2<>(limit1(), skip1());
    }
766647
def descendants(self):
        
        return self.members + \
            [submember for member in self.members for submember in member.descendants]
20179
def union(a: Iterable[Any], b: Iterable[Any]) -> List[Any]:
    
    u = []  # type: List[Any]
    for item in a:
        if item not in u:
            u.append(item)
    for item in b:
        if item not in u:
            u.append(item)
    return u
193892
def members(self):
        ''''''
        with self._mutex:
            if not self._members:
                self._members = {}
                for o in self.organisations:
                    # TODO: Search for these in the tree
                    self._members[o.org_id] = o.obj.get_members()
        return self._members
247273
def iter_members(self):
        
        if self.everything:
            raise ValueError("Can not iterate everything")
        for coord in sorted(self.elements):
            yield coord
215521
def pairwise(
    iterable: Iterable,
    default_value: Any,
) -> Iterable[Tuple[Any, Any]]:
    
    a, b = tee(iterable)
    _ = next(b, default_value)
    return zip_longest(a, b, fillvalue=default_value)
766154
def _mapping_to_tuple_pairs(d):
    
    # order the keys, this will prevent different implementations of Python,
    # return different results from the same dictionary since the order of
    # iteration depends on it
    t = []
    ord_keys = sorted(d.keys())
    for k in ord_keys:
        t.append(_product(k, d[k]))
    return tuple(product(*t))
998882
def pairs(iterable):
    
    a, b = itertools.tee(iterable)
    next(b, None)
    return zip(a, b)
290098
def n_members(self):
        
        if self.is_finite:
            return reduce(mul, [domain.n_members for domain in self._domains], 1)
        else:
            return np.inf