class_docstr: A tree implementation.
class_docstr_tok: ["A","tree","implementation","."]
docstr: Add a leaf to the tree.
docstr_tok: ["Add","a","leaf","to","the","tree","."]
code: def add_leaf(self, ds_id, parent=None):
      """Add a leaf to the tree."""
      if parent is None:
          parent = self._root
      try:
          node = self[ds_id]
      except KeyError:
          node = Node(ds_id)
      self.add_child(parent, node)
      return node
  
imports: from __future__ import annotations
  from typing import Container, Iterable, Optional
  import numpy
  from satpy import DataID, DatasetDict
  from satpy.dataset import ModifierTuple, create_filtered_query
  from satpy.dataset.data_dict import TooManyResults, get_key
  from satpy.node import EMPTY_LEAF_NAME, LOG, CompositorNode, MissingDependencies, Node, ReaderNode
label_desc: Use image node_id 5 for calling the Tree obj's underlying member method code with example usage: obj.add_leaf(ds_id, parent) and returns: node