Exemplo n.º 1
0
def tabdetect(file):
    top = list(
        filter(
            ne(0),
            pluck(
                0,
                Counter(
                    starmap(
                        comp(abs, sub),
                        pairwise(
                            cons(0, map(leadspace,
                                        filter(str.strip,
                                               file)))))).most_common(2))))
    return top[0] if top else 1
Exemplo n.º 2
0
def everything_but(k, d):
    """
    Return iterator of all values in d except the values in k.
    """
    assert k in d
    return concat(itervalues(keyfilter(ne(k), d)))
Exemplo n.º 3
0
def everything_but(k, d):
    """
    Return iterator of all values in d except the values in k.
    """
    assert k in d
    return concat(itervalues(keyfilter(ne(k), d)))