'Checks if the activity is present in any of the aggregated activities
:param activity: the activity to search for'

def contains(self, activity):

    aggregated = self[:self.max_length]
    activities = sum([list(a.activities) for a in aggregated], [])
    activities = copy.deepcopy(activities)
    activity = copy.deepcopy(activity)
    activity_dict = dict()
    for a in activities:
        key = (a.verb.id, a.actor_id, a.object_id, a.target_id)
        activity_dict[key] = a
    a = activity
    activity_key = (a.verb.id, a.actor_id, a.object_id, a.target_id)
    present = (activity_key in activity_dict)
    return present
