

def is_gde_post(activity):
    'Identify gde post.'
    content = activity['object']['content']
    if ('annotation' in activity):
        content += (' ' + activity['annotation'])
    if (not is_valid_expert_tag(content)):
        return False
    if ('verb' in activity):
        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

dataset/ETHPy150Open GoogleDeveloperExperts/experts-app-backend/services/update_gplus.py is_gde_post/original