

def _get_times(self, event):
    audit_period_beginning = event.get('audit_period_beginning')
    audit_period_ending = event.get('audit_period_ending')
    launched_at = event.get('launched_at')
    terminated_at = event.get('terminated_at')
    if (not terminated_at):
        terminated_at = event.get('deleted_at')
    start_time = max(launched_at, audit_period_beginning)
    if (not terminated_at):
        end_time = audit_period_ending
    else:
        end_time = min(terminated_at, audit_period_ending)
    if (start_time > end_time):
        start_time = audit_period_beginning
    return (start_time, end_time)

dataset/ETHPy150Open openstack/stacktach-winchester/winchester/pipeline_handler.py AtomPubHandler._get_times/original