This file is indexed.

/usr/lib/python3/dist-packages/toolz/tests/test_recipes.py is in python3-toolz 0.8.2-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from toolz import first, identity, countby, partitionby


def iseven(x):
    return x % 2 == 0


def test_countby():
    assert countby(iseven, [1, 2, 3]) == {True: 1, False: 2}
    assert countby(len, ['cat', 'dog', 'mouse']) == {3: 2, 5: 1}
    assert countby(0, ('ab', 'ac', 'bc')) == {'a': 2, 'b': 1}


def test_partitionby():
    assert list(partitionby(identity, [])) == []

    vowels = "aeiou"
    assert (list(partitionby(vowels.__contains__, "abcdefghi")) ==
            [("a",), ("b", "c", "d"), ("e",), ("f", "g", "h"), ("i",)])

    assert (list(map(first,
                     partitionby(identity,
                                 [1, 1, 1, 2, 3, 3, 2, 2, 3]))) ==
            [1, 2, 3, 2, 3])

    assert ''.join(map(first,
                       partitionby(identity, "Khhhaaaaannnnn!!!!"))) == 'Khan!'