Make a bool array based on start and stop conditions.

    pack:
        pack.ChannelPack instance

    If there is start conditions but no stop conditions, this is legal,
    the True section will begin at first start and remain the rest of
    the array. Likewise, if there is stop conditions but no start
    condition, the returned array will be all True until the first stop
    slice, and the rest of the array is set to False.

def startstop_bool(pack):
    """Make a bool array based on start and stop conditions.

    pack:
        pack.ChannelPack instance

    If there is start conditions but no stop conditions, this is legal,
    the True section will begin at first start and remain the rest of
    the array. Likewise, if there is stop conditions but no start
    condition, the returned array will be all True until the first stop
    slice, and the rest of the array is set to False.

    """
    b_TRUE = np.ones(pack.rec_cnt) == True  # NOQA

    start_list = pack.conconf.conditions_list('startcond')
    stop_list = pack.conconf.conditions_list('stopcond')

    # Pre-check:
    runflag = 'startstop'
    if not start_list and not stop_list:
        return b_TRUE
    elif not start_list:
        runflag = 'stoponly'
    elif not stop_list:
        runflag = 'start_only'

    # startb:
    if runflag == 'stoponly':
        # all False (dummy assignment)
        startb = b_TRUE == False  # NOQA
    else:
        startb = b_TRUE
        for cond in start_list:
            startb = startb & pack._mask_array(cond)

    # stopb:
    if runflag == 'startonly':
        # all False (dummy assignment)
        stopb = b_TRUE == False  # NOQA
    else:
        stopb = b_TRUE
        for cond in stop_list:
            stopb = stopb & pack._mask_array(cond)

    stopextend = pack.conconf.get_stopextend()

    return _startstop_bool(startb, stopb, runflag, stopextend)