def __getitem__(self, x):
        """
        Convert a co-ordinate to a bin index.  The co-ordinate can
        be a single value, or a Python slice instance describing a
        range of values.  If a single value is given, it is mapped
        to the bin index corresponding to that value.  If a slice
        is given, it is converted to a slice whose lower bound is
        the index of the bin in which the slice's lower bound
        falls, and whose upper bound is 1 greater than the index of
        the bin in which the slice's upper bound falls.  Steps are
        not supported in slices.
        """
        if isinstance(x, slice):
            if x.step is not None:
                raise NotImplementedError("step not supported: %s" % repr(x))
            return slice(self[x.start] if x.start is not None
                         else 0, self[x.stop] + 1 if x.stop is not None
                         else len(self))
        raise NotImplementedError
def __getitem__ ( self , x ) : if isinstance ( x , slice ) : if x . step is not None : raise NotImplementedError ( "step not supported: %s" % repr ( x ) ) return slice ( self [ x . start ] if x . start is not None else 0 , self [ x . stop ] + 1 if x . stop is not None else len ( self ) ) raise NotImplementedError
Convert a co-ordinate to a bin index.  The co-ordinate can
        be a single value, or a Python slice instance describing a
        range of values.  If a single value is given, it is mapped
        to the bin index corresponding to that value.  If a slice
        is given, it is converted to a slice whose lower bound is
        the index of the bin in which the slice's lower bound
        falls, and whose upper bound is 1 greater than the index of
        the bin in which the slice's upper bound falls.  Steps are
        not supported in slices.