docs: def distance_matrix(self, leaf_labels=False):
          '''Return a distance matrix (2D dictionary) of the leaves of this ``Tree``
  
          Args:
              ``leaf_labels`` (``bool``): ``True`` to have keys be labels of leaf ``Node`` objects, otherwise ``False`` to have keys be ``Node`` objects
  
          Returns:
              ``dict``: Distance matrix (2D dictionary) of the leaves of this ``Tree``, where keys are labels of leaves; ``M[u][v]`` = distance from ``u`` to ``v``
          '''
          M = dict(); leaf_dists = dict()
          for node in self.traverse_postorder():
              if node.is_leaf():
                  leaf_dists[node] = [[node,0]]
              else:
                  for c in node.children:
                      if c.edge_length is not None:
                          for i in range(len(leaf_dists[c])):
                              leaf_dists[c][i][1] += c.edge_length
                  for c1 in range(0,len(node.children)-1):
                      leaves_c1 = leaf_dists[node.children[c1]]
                      for c2 in range(c1+1,len(node.children)):
                          leaves_c2 = leaf_dists[node.children[c2]]
                          for i in range(len(leaves_c1)):
                              for j in range(len(leaves_c2)):
                                  u,ud = leaves_c1[i]; v,vd = leaves_c2[j]; d = ud+vd
                                  if leaf_labels:
                                      u_key = u.label; v_key = v.label
                                  else:
                                      u_key = u; v_key = v
                                  if u_key not in M:
                                      M[u_key] = dict()
                                  M[u_key][v_key] = d
                                  if v_key not in M:
                                      M[v_key] = dict()
                                  M[v_key][u_key] = d
                  leaf_dists[node] = leaf_dists[node.children[0]]; del leaf_dists[node.children[0]]
                  for i in range(1,len(node.children)):
                      leaf_dists[node] += leaf_dists[node.children[i]]; del leaf_dists[node.children[i]]
          return M