docs: def _startstop_bool(startb, stopb, runflag, stopextend):
      """Return boolean array based on start and stop conditions.
  
      startb, stopb: Numpy 1D arrays of the same length.
          Boolean arrays for start and stop conditions being fullfilled or not.
  
      """
      # All false at start
      res = np.zeros(len(startb)) == True  # NOQA
  
      start_slices = slicelist(startb)
      stop_slices = slicelist(stopb)
  
      # Special case when there is a start but no stop slice or vice versa:
      # if start_slices and not stop_slices:
      if runflag == 'startonly':
          try:
              start = start_slices[0]
              # Make True from first start and rest of array.
              res[start.start:] = True
              return res
          except IndexError:
              # Only start specified but no start condition
              # fullfilled. Return all False.
              return res
  
      elif runflag == 'stoponly':
          try:
              stop = stop_slices[0]
              res[:stop.start + stopextend] = True  # Make True up to first stop.
              return res
          except IndexError:
              # Only stop specified but no stop condition fullfilled
              # Return all True
              return res == False  # NOQA
  
      stop = slice(0, 0)           # For first check
      start = slice(0, 0)          # For a possibly empty list start_slices.
      for start in start_slices:
          if start.start < stop.start:
              continue
          for stop in stop_slices:
              if stop.start > start.start:
                  res[start.start: stop.start + stopextend] = True
                  break           # Next start
          else:
              # On a given start slice, the entire list of stop slices was
              # exhausted, none being later than the given start. It must mean
              # that from this given start, the rest is to be True:
              break
  
      # There was no stop for the last start in loop
      if start.start > stop.start:
          res[start.start:] = True
  
      return res