def get_random_EMA(cur_dir, filename) -> List[DataPoint]:
    emas = get_EMA_data(cur_dir, filename)
    data = []
    for ema in emas:
        d = ema[2]
        jsn_file = json.loads(d)
        status = jsn_file['status']
        if (status == 'COMPLETED'):
            is_smoked = jsn_file['question_answers'][32]['response'][0]
            if (is_smoked == 'Yes'):
                nSmoked = jsn_file['question_answers'][33]['response'][0]
                if (int(nSmoked) == 1):
                    nQI = 34
                else:
                    nQI = 35
                howlong_ago = jsn_file['question_answers'][nQI]['response']
                sample = [int(nSmoked)]
                for hla in howlong_ago:
                    hla = str(hla)
                    if (hla in ['More than 12 hrs']):
                        sample.extend([(((12 * 60) * 60) * 1000), (((24 * 60) * 60) * 1000)])
                        continue
                    st = hla.split('-')[0]
                    et = hla.split('-')[1]
                    st = st.split(' ')[0]
                    st = (((int(st.strip()) * 60) * 60) * 1000)
                    et = et.strip().split(' ')[0]
                    et = (((int(et.strip()) * 60) * 60) * 1000)
                    sample.extend([st, et])
                data.append(DataPoint(start_time=ema[0], offset=ema[1], sample=sample))
    return data
def get_random_EMA(cur_dir, filename) -> List[DataPoint]:
    emas = get_EMA_data(cur_dir, filename)
    data = []
    for ema in emas:
        d = ema[2]
        jsn_file = json.loads(d)
        status = jsn_file['status']
        if (status == 'COMPLETED'):
            is_smoked = jsn_file['question_answers'][32]['response'][0]
            if (is_smoked == 'Yes'):
                nSmoked = jsn_file['question_answers'][33]['response'][0]
                if (int(nSmoked) == 1):
                    nQI = 34
                else:
                    nQI = 35
                howlong_ago = jsn_file['question_answers'][nQI]['response']
                sample = [int(nSmoked)]
                for hla in howlong_ago:
                    hla = str(hla)
                    if (hla in ['More than 12 hrs']):
                        sample.extend([(((12 * 60) * 60) * 1000), (((24 * 60) * 60) * 1000)])
                        continue
                    st = hla.split('-')[0]
                    et = hla.split('-')[1]
                    st = st.split(' ')[0]
                    st = (((int(st.strip()) * 60) * 60) * 1000)
                    et = et.strip().split(' ')[0]
                    et = (((int(et.strip()) * 60) * 60) * 1000)
                    sample.extend([st, et])
                data.append(DataPoint(start_time=ema[0], offset=ema[1], sample=sample))
    return data