def get_in_standard_from(self): """ >>> c = InputOutput() >>> c[1] = {Context(value=1.0, cohorts=[0])} >>> c[2] = {Context(value=1.0, cohorts=[0,1,2,4])} >>> c.get_in_standard() == {1: [[0], []], 2: [[], [0, 1, 2, 4]]} True """ results = {} for key, value in self.dictionary.items(): results[key] = contexts_to_standard(value) return results
def to_string(self): result = {} for i, value in self.dictionary.items(): result[i] = contexts_to_standard(value) if is_empty_dictionary(result): return "{}" return str(result)