bolt/utils.py
def listify(lst, dim):
    """
    Flatten lists of indices and ensure bounded by a known dim.

    Parameters
    ----------
    lst : list
        List of integer indices

    dim : tuple
        Bounds for indices
    """
    if not all([l.dtype == int for l in lst]):
        raise ValueError("indices must be integers")

    if npany(asarray(lst) >= dim):
        raise ValueError("indices out of bounds for axis with size %s" % dim)

    return lst.flatten()
def listify(lst, dim):
    if not all([l.dtype == int for l in lst]):
        raise ValueError("indices must be integers")

    if npany(asarray(lst) >= dim):
        raise ValueError("indices out of bounds for axis with size %s" % dim)

    return lst.flatten()
def listify ( lst , dim ) : if not all ( [ l . dtype == int for l in lst ] ) : raise ValueError ( "indices must be integers" ) if npany ( asarray ( lst ) >= dim ) : raise ValueError ( "indices out of bounds for axis with size %s" % dim ) return lst . flatten ( )
Flatten lists of indices and ensure bounded by a known dim.

    Parameters
    ----------
    lst : list
        List of integer indices

    dim : tuple
        Bounds for indices
Flatten lists of indices and ensure bounded by a known dim .