def METHOD_NAME(mask, dim=0):
    shape = mask.shape
    m0 = numpy.sum(mask, axis=dim, dtype="int") == shape[dim]
    if m0.any():
        m0 = numpy.asarray(m0, "int8")
        d0=m0[1:]-m0[:-1]
        starts = numpy.where(d0==1)[0]
        stops = numpy.where(d0==-1)[0]
        if  (len(starts) == 0):
            starts = numpy.array([-1])
        if  (len(stops) == 0):
            stops = numpy.array([len(m0)-1])
        if (stops[0]<starts[0]):
            starts = numpy.concatenate(([-1], starts))
        if (stops[-1]<starts[-1]):
            stops = numpy.concatenate((stops, [len(m0)-1]))
        r0 = [ (start+1, stop+1) for start,stop  in zip(starts, stops)]
    else:
        r0 = []
    return r0