'Delete all predicates (except 1) from subjects with many predicates.'

def _RemoveManyAttributes(self, subjects, fraction):

    self.test_name = ('del    +attrs    %d%%' % fraction)
    often = (100 / fraction)
    count = 0
    for i in subjects:
        subject = subjects[i]['name']
        predicates = subjects[i]['attrs']
        number_predicates = len(predicates)
        if (number_predicates >= self.BIG_NUM_ATTRIBUTES):
            count += 1
            if (count == often):
                count = 0
                predicates_to_delete = [j for j in predicates.keys()[1:]]
                values_deleted = sum((len(predicates[x]) for x in predicates_to_delete))
                self.values -= values_deleted
                self.predicates -= len(predicates_to_delete)
                for j in predicates_to_delete:
                    del predicates[j]
                    data_store.DB.DeleteAttributes(subject, [(self.predicate_template % j)], sync=False, token=self.token)
                    self.Register()
    data_store.DB.Flush()
