def windowed_run_events_1d(arr, window):
    """Return the number of runs of a minimum length.

    Parameters
    ----------
    arr : bool array
      Input array

    window : int
      Minimum run length.

    Returns
    -------
    out : func
      Number of distinct runs of a minimum length.
    """
    v, rl, pos = rle_1d(arr)
    return (v * rl >= window).sum()