def get_RICE_PILOT_EMAs(pid):
    cur_dir = ((data_dir + pid) + '/')
    smoking_epis = load_data_offset((cur_dir + get_fileName(cur_dir, streamprocessor_puffmarker_smoking_epi_file)))
    smoking_selfreport = get_smoking_self_report(cur_dir, get_fileName(cur_dir, smoking_self_report_file))
    smoking_emas = get_smoking_EMA(cur_dir, get_fileName(cur_dir, ema_smoking_file))
    random_emas = get_random_EMA(cur_dir, get_fileName(cur_dir, ema_random_file))
    stressed_emas = get_random_EMA(cur_dir, get_fileName(cur_dir, ema_stressed_file))
    sup_sr = ([0] * len(smoking_epis))
    sup_cr = ([0] * len(smoking_epis))
    sup_ema = ([0] * len(smoking_epis))
    for (i, epi) in enumerate(smoking_epis):
        for sr in smoking_selfreport:
            time_diff = (sr.start_time - epi.start_time).total_seconds()
            if ((time_diff > (- 1800)) and (time_diff < 1800)):
                sup_sr[i] = 1
                break
        for sr in smoking_emas:
            time_diff = (sr.start_time - epi.start_time).total_seconds()
            if ((time_diff > (- 600)) and (time_diff < 1800)):
                sup_cr[i] = 1
                break
        for re in random_emas:
            st = (re.start_time - timedelta(milliseconds=re.sample[2]))
            et = (re.start_time - timedelta(milliseconds=re.sample[1]))
            if ((epi.start_time >= st) and (epi.start_time <= et)):
                sup_ema[i] = 1
                break
        for re in stressed_emas:
            st = (re.start_time - timedelta(milliseconds=re.sample[2]))
            et = (re.start_time - timedelta(milliseconds=re.sample[1]))
            if ((epi.start_time >= st) and (epi.start_time <= et)):
                sup_ema[i] = 1
                break
    sup = [(((sup_sr[i] * 100) + (sup_cr[i] * 10)) + sup_ema[i]) for i in range(len(sup_ema))]
    print(((((((('se=' + str(len(smoking_epis))) + ' : sup sr = ') + str(sum(sup_sr))) + ' : sup cr = ') + str(sum(sup_cr))) + ' : sup ema = ') + str(sum(sup_ema))))
    non_sup = len([v for v in sup if (v == 0)])
    print(((('Supported : Not supported = ' + str((len(sup) - non_sup))) + ' : ') + str(non_sup)))
def get_RICE_PILOT_EMAs(pid):
    cur_dir = ((data_dir + pid) + '/')
    smoking_epis = load_data_offset((cur_dir + get_fileName(cur_dir, streamprocessor_puffmarker_smoking_epi_file)))
    smoking_selfreport = get_smoking_self_report(cur_dir, get_fileName(cur_dir, smoking_self_report_file))
    smoking_emas = get_smoking_EMA(cur_dir, get_fileName(cur_dir, ema_smoking_file))
    random_emas = get_random_EMA(cur_dir, get_fileName(cur_dir, ema_random_file))
    stressed_emas = get_random_EMA(cur_dir, get_fileName(cur_dir, ema_stressed_file))
    sup_sr = ([0] * len(smoking_epis))
    sup_cr = ([0] * len(smoking_epis))
    sup_ema = ([0] * len(smoking_epis))
    for (i, epi) in enumerate(smoking_epis):
        for sr in smoking_selfreport:
            time_diff = (sr.start_time - epi.start_time).total_seconds()
            if ((time_diff > (- 1800)) and (time_diff < 1800)):
                sup_sr[i] = 1
                break
        for sr in smoking_emas:
            time_diff = (sr.start_time - epi.start_time).total_seconds()
            if ((time_diff > (- 600)) and (time_diff < 1800)):
                sup_cr[i] = 1
                break
        for re in random_emas:
            st = (re.start_time - timedelta(milliseconds=re.sample[2]))
            et = (re.start_time - timedelta(milliseconds=re.sample[1]))
            if ((epi.start_time >= st) and (epi.start_time <= et)):
                sup_ema[i] = 1
                break
        for re in stressed_emas:
            st = (re.start_time - timedelta(milliseconds=re.sample[2]))
            et = (re.start_time - timedelta(milliseconds=re.sample[1]))
            if ((epi.start_time >= st) and (epi.start_time <= et)):
                sup_ema[i] = 1
                break
    sup = [(((sup_sr[i] * 100) + (sup_cr[i] * 10)) + sup_ema[i]) for i in range(len(sup_ema))]
    print(((((((('se=' + str(len(smoking_epis))) + ' : sup sr = ') + str(sum(sup_sr))) + ' : sup cr = ') + str(sum(sup_cr))) + ' : sup ema = ') + str(sum(sup_ema))))
    non_sup = len([v for v in sup if (v == 0)])
    print(((('Supported : Not supported = ' + str((len(sup) - non_sup))) + ' : ') + str(non_sup)))