<commit_before>from feedly.activity import AggregatedActivity, Notification
from copy import deepcopy


class BaseAggregator(object):
    aggregation_class = AggregatedActivity

    def __init__(self):
        pass

    def aggregate(self, activities):
        '''
        Runs the group activities (using get group)
        Ranks them using the giving ranking function
        And returns the sorted activities
        '''
        aggregate_dict = self.group_activities(activities)
        aggregated_activities = aggregate_dict.values()
        ranked_aggregates = self.rank(aggregated_activities)
        return ranked_aggregates
    
    def merge(self, activities, new_activities):
        '''
        Returns
        new, changed
        where changed is activity list with tuples of old, new
        '''
        current_activities_dict = dict([(a.group, a) for a in activities])
        new = []
        changed = []
        for aggregated in new_activities:<commit_msg>rename<commit_after>from feedly.activity import AggregatedActivity, Notification
from copy import deepcopy


class BaseAggregator(object):
    aggregation_class = AggregatedActivity

    def __init__(self):
        pass

    def aggregate(self, activities):
        '''
        Runs the group activities (using get group)
        Ranks them using the giving ranking function
        And returns the sorted activities
        '''
        aggregate_dict = self.group_activities(activities)
        aggregated_activities = aggregate_dict.values()
        ranked_aggregates = self.rank(aggregated_activities)
        return ranked_aggregates
    
    def merge(self, aggregated, new_aggregated):
        '''
        Returns
        new, changed
        where changed is activity list with tuples of old, new
        '''
        current_activities_dict = dict([(a.group, a) for a in aggregated])
        new = []
        changed = []
        for aggregated in new_aggregated:
{'fraction_non_alphanumeric': 0.0667693888032871, 'fraction_numerical': 0.0, 'mean_word_length': 2.6007393715341958, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3070650', 'n_tokens_mistral': 505, 'n_tokens_neox': 491, 'n_words': 151}