This file is indexed.

/usr/lib/python2.7/dist-packages/chaco/abstract_colormap.py is in python-chaco 4.5.0-1.

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
""" Defines the base class for color maps
"""
from traits.api import Enum, Event, HasTraits, Instance

from data_range_1d import DataRange1D

class AbstractColormap(HasTraits):
    """
    Abstract class for color maps, which map from scalar values to color values.
    """

    # The data-space bounds of the mapper.
    range = Instance(DataRange1D)

    # The color depth of the colors to use.
    color_depth = Enum('rgba', 'rgb')

    # A generic "update" event that generally means that anything that relies
    # on this mapper for visual output should do a redraw or repaint.
    updated = Event

    def map_screen(self, val):
        """
        map_screen(val) -> color

        Maps an array of values to an array of colors.  If the input array is
        NxM, the returned array is NxMx3 or NxMx4, depending on the
        **color_depth** setting.
        """
        raise NotImplementedError()

    def map_data(self, ary):
        """
        map_data(ary) -> color_array

        Returns an array of values containing the colors mapping to the values
        in *ary*. If the input array is NxM, the returned array is NxMx3 or
        NxMx4, depending on the **color_depth** setting.
        """
        # XXX this seems bogus: by analogy with AbstractMapper, this should map
        # colors to data values, and that will be generally hard to do well.
        # no subclass implements this - CJW
        raise NotImplementedError()

    def map_index(self, ary):
        """
        map_index(ary) -> index into color_bands

        This method is like map_screen(), but it returns an array of indices
        into the color map's color bands instead of an array of colors.  If the
        input array is NxM, then the output is NxM integer indices.

        This method might not apply to all color maps.  Ones that cannot
        define a static set of color bands (e.g., function-defined color maps)
        are not able to implement this function.
        """
        raise NotImplementedError()

    def map_uint8(self, val):
        """
        map_uint8(val) -> rgb24 or rgba32 color

        Maps a single value to a single color.  Color is represented as either
        length-3 or length-4 array of rgb(a) uint8 values, depending on the
        **color_depth** setting.
        """
        # default implementation (not efficient)
        return (self.map_screen(val)*255.0).astype('uint8')



# EOF