def eval_cutoff_window()

in src/lambda/InvokeFraudEndpointLambda/lambda_function.py [0:0]


def eval_cutoff_window(agg_evt_time):
    # Test if aggregate event time has been too long ago
    cutoff_condition = False
    now = time.time()
    cutoff_time = now - agg_evt_time
    logging.debug(f'Calculate time diff as: {now} - {agg_evt_time} => {cutoff_time}')

    if cutoff_time > TEN_MINUTES_IN_SEC:
        # assume current agg features are all ZERO
        cutoff_condition = True

    logging.info(f'cutoff_condition: {cutoff_condition} based on agg_evt_time: {agg_evt_time} and cutoff_time: {cutoff_time}')
    return cutoff_condition