def is_gde_post(activity):
    # first find out wether the post contains #gde
    content = activity['object']['content']
    if 'annotation' in activity:
        content += ' ' + activity['annotation']
    # result = re.search('(#(gde</a>))', content, flags=re.IGNORECASE)
    if not is_valid_expert_tag(content):
        return False
    # find out wether the verb of the post is 'post'
    # alternatively is the verb is 'share' then verify that
    # actor.id of the share and the original post are the same
    if 'verb' in activity:
        # when the verb is 'checkin' the ["object"]["actor "] key does not
        # exist
        if activity["verb"] == 'checkin':
            return False
        if activity["verb"] == 'post':
            return True
        elif activity["object"]["actor"]["id"] == activity["actor"]["id"]:
            return True
        else:
            return False
    else:
        return True
Identify gde post.
dataset/ETHPy150Open GoogleDeveloperExperts/experts-app-backend/services/update_gplus.py/is_gde_post