docs: def order(self, mode, ascending=True):
          '''Order the children of the nodes in this ``Tree`` based on ``mode``
  
          Args:
              ``mode`` (``str``): How to order the children of the nodes of this ``Tree``
  
              * ``"edge_length"`` = order by incident edge length
  
              * ``"edge_length_then_label"`` = order by incident edge length, then by node label
  
              * ``"edge_length_then_label_then_num_descendants"`` = order by incident edge length, then by node label, then by number of descendants
  
              * ``"edge_length_then_num_descendants"`` = order by incident edge length, then by number of descendants
  
              * ``"edge_length_then_num_descendants_then_label"`` = order by incident edge length, then by number of descendants, then by node label
  
              * ``"label"`` = order by node label
  
              * ``"label_then_edge_length"`` = order by node label, then by incident edge length
  
              * ``"label_then_edge_length_then_num_descendants"`` = order by node label, then by incident edge length, then by number of descendants
  
              * ``"label_then_num_descendants"`` = order by node label, then by number of descendants
  
              * ``"label_then_num_descendants_then_edge_length"`` = order by node label, then by number of descendants, then by incident edge length
  
              * ``"num_descendants"`` = order by number of descendants
  
              * ``"num_descendants_then_label"`` = order by number of descendants, then by node label
  
              * ``"num_descendants_then_label_then_edge_length"`` = order by number of descendants, then by node label, then by incident edge length
  
              * ``"num_descendants_then_edge_length"`` = order by number of descendants, then by incident edge length
  
              * ``"num_descendants_then_edge_length_then_label"`` = order by number of descendants, then by incident edge length, then by node label
  
              ``ascending`` (``bool``): ``True`` to sort in ascending order of ``mode``, otherwise ``False``
          '''
          if not isinstance(mode, str):
              raise TypeError("mode must be a str")
          if not isinstance(ascending, bool):
              raise TypeError("ascending must be a bool")
          if 'num_descendants' in mode:
              num_descendants = dict()
              for node in self.traverse_postorder():
                  if node.is_leaf():
                      num_descendants[node] = 0
                  else:
                      num_descendants[node] = sum(num_descendants[c] for c in node.children) + len(node.children)
          if mode == 'edge_length':
              k = lambda node: (node.edge_length is not None, node.edge_length)
          elif mode == 'edge_length_then_label':
              k = lambda node: (node.edge_length is not None, node.edge_length, node.label is not None, node.label)
          elif mode == 'edge_length_then_label_then_num_descendants':
              k = lambda node: (node.edge_length is not None, node.edge_length, node.label is not None, node.label, num_descendants[node])
          elif mode == 'edge_length_then_num_descendants':
              k = lambda node: (node.edge_length is not None, node.edge_length, num_descendants[node])
          elif mode == 'edge_length_then_num_descendants_then_label':
              k = lambda node: (node.edge_length is not None, node.edge_length, num_descendants[node], node.label is not None, node.label)
          elif mode == 'label':
              k = lambda node: (node.label is not None, node.label)
          elif mode == 'label_then_edge_length':
              k = lambda node: (node.label is not None, node.label, node.edge_length is not None, node.edge_length)
          elif mode == 'label_then_edge_length_then_num_descendants':
              k = lambda node: (node.label is not None, node.label, node.edge_length is not None, node.edge_length, num_descendants[node])
          elif mode == 'label_then_num_descendants':
              k = lambda node: (node.label is not None, node.label, num_descendants[node])
          elif mode == 'label_then_num_descendants_then_edge_length':
              k = lambda node: (node.label is not None, node.label, num_descendants[node], node.edge_length is not None, node.edge_length)
          elif mode == 'num_descendants':
              k = lambda node: num_descendants[node]
          elif mode == 'num_descendants_then_label':
              k = lambda node: (num_descendants[node], node.label is not None, node.label)
          elif mode == 'num_descendants_then_label_then_edge_length':
              k = lambda node: (num_descendants[node], node.label is not None, node.label, node.edge_length is not None, node.edge_length)
          elif mode == 'num_descendants_then_edge_length':
              k = lambda node: (num_descendants[node], node.edge_length is not None, node.edge_length)
          elif mode == 'num_descendants_then_edge_length_then_label':
              k = lambda node: (num_descendants[node], node.edge_length is not None, node.edge_length, node.label is not None, node.label)
          else:
              raise ValueError("Invalid choice for mode")
          for node in self.traverse_preorder():
              node.children.sort(key=k, reverse=not ascending)