code: def longest_run_1d(arr):
      
      v, rl = rle_1d(arr)[:2]
      return np.where(v, rl, 0).max()
docs: Return the length of the longest consecutive run of identical values.
  
      Parameters
      ----------
      arr : bool array
        Input array
  
      Returns
      -------
      int
        Length of longest run.