def find(symbs, allsymbs):
    """
Sort elements in symbs according to allsymbs to form and return (args, inds)
with list of ordered arguments as args and corresponding list of indices in
allsymbs as inds.
    """
    args = []
    inds = []
    n = 0
    for symb in allsymbs:
        if symb in symbs:
            args.append(symb)
            inds.append(n)
        n += 1
    return tuple(args), tuple(inds)
