def validate ( self, object, name, value ):
        """ Validates that a specified value is valid for this trait.
        """
        if type(value) is int:
            return value
        elif type(value) is long:
            return int(value)

        try:
            int_value = operator.index( value )
        except __HOLE__:
            pass
        else:
            return int(int_value)

        self.error( object, name, value )
dataset/ETHPy150Open enthought/traits/traits/trait_types.py/BaseInt.validate