def annotate_instances(instances):
    for inst in instances:
        # set _excluded
        excluded = False
        tags = inst.get('tags', {}).get('items', [])
        inst['_tags'] = tags

        for tag in tags:
            if tag.lower() in CONFIG['SAFE_TAGS']:
                excluded = True
                break
        inst['_excluded'] = excluded

        # set _age_minutes and _timeout_expired
        # _timeout_expired is never True for _excluded inst
        creation = parse_iso8601tz(inst['creationTimestamp'])
        now = datetime.datetime.now()
        delta = now - creation
        age_minutes = (delta.days * 24 * 60) + (delta.seconds / 60)
        inst['_age_minutes'] = age_minutes
        # >= comparison because seconds are truncated above.
        if not inst['_excluded'] and age_minutes >= CONFIG['TIMEOUT']:
            inst['_timeout_expired'] = True
        else:
            inst['_timeout_expired'] = False
loops through the instances and adds exclusion, age and timeout
dataset/ETHPy150Open googlearchive/compute-appengine-timeout-python/main.py/annotate_instances