def METHOD_NAME(cls, node: TimingTreeNode, depth: int):
    indent = " " * 2 * depth
    leaf_nodes = ((k, v) for k, v in node.timing.items() if not v.timing)
    nonleaf_nodes = ((k, v) for k, v in node.timing.items() if v.timing)
    def node_str(k, node_):
        return f"{k}: {cls._time_str(node_.self_time)}"
    tokens = []
    for key, child_node in leaf_nodes:
        tokens.append(node_str(key, child_node))
    lines = []
    if tokens:
        lines.append(f'{indent}{", ".join(tokens)}')
    for key, child_node in nonleaf_nodes:
        lines.append(f"{indent}{node_str(key, child_node)}")
        lines.extend(cls.METHOD_NAME(child_node, depth + 1))
    return lines