def valid_int(x, cast=None):

    if cast is None:
        cast = np.floor

    if not six.callable(cast):
        raise ParameterError('cast parameter must be callable')

    return int(cast(x))
Convert a generic object into a NumPy object compliant with atom.
dataset/ETHPy150Open bmcfee/librosa/librosa/util/utils.py/valid_int--crossover with--dataset/ETHPy150Open PyTables/PyTables/tables/utils.py/convert_to_np_atom2