'Add lots of predicates to a given number of subjects.'

def _AddManyAttributes(self, subjects, many):

    self.test_name = ('add    +attrs    %d' % many)
    new_value = os.urandom(100)
    for _ in range(0, many):
        i = self.rand.choice(subjects.keys())
        subject = subjects[i]['name']
        predicates = subjects[i]['attrs']
        how_many = self.rand.randint(self.BIG_NUM_ATTRIBUTES, (self.BIG_NUM_ATTRIBUTES + 1000))
        self.predicates += how_many
        new_predicate = (max(predicates.iteritems(), key=operator.itemgetter(0))[0] + 1)
        for j in xrange(new_predicate, (new_predicate + how_many)):
            number_timestamps = self.rand.randrange(1, 3)
            ts = [(100 * (ts + 1)) for ts in xrange(number_timestamps)]
            self.values += number_timestamps
            values = [(new_value, t) for t in ts]
            predicates[j] = ts
            data_store.DB.MultiSet(subject, {(self.predicate_template % j): values}, replace=False, timestamp=100, sync=False, token=self.token)
            self.Register()
    data_store.DB.Flush()
