+ details.num_populated_buckets += 1
+ details.last_bucket_start = start
+ if details.max_population is None or pop > details.max_population:
+ details.max_population = pop
+ if details.lowest_start is None or start < details.lowest_start:
+ details.lowest_start = start
+ if details.highest_end is None or end > details.highest_end:
+ details.highest_end = end
+ label = f'[{label_formatter}..{label_formatter}): ' % (start, end)
+ label_width = len(label)
+ if details.max_label_width is None or label_width > details.max_label_width:
+ details.max_label_width = label_width
+ return details
+
+ def __repr__(self, *, width: int = 80, label_formatter: str = '%d') -> str:
+ from text_utils import bar_graph
+
+ details = self.get_bucket_details(label_formatter)