class_docstr: Represents a dendrogram, a tree with a specified branching order.  This
  must be initialised with the leaf items, then iteratively call merge for
  each branch. This class constructs a tree representing the order of calls
  to the merge function.
docstr: Print the dendrogram in ASCII art to standard out.
  
  :param leaf_labels: an optional list of strings to use for labeling the
                      leaves
  :type leaf_labels: list
docstr_tok: ["Print","the","dendrogram","in","ASCII","art","to","standard","out",".",":","param","leaf_labels",":","an","optional","list","of","strings","to","use","for","labeling","the","leaves",":","type","leaf_labels",":","list"]
code: def show(self, leaf_labels=[]):
      """
      Print the dendrogram in ASCII art to standard out.
  
      :param leaf_labels: an optional list of strings to use for labeling the
                          leaves
      :type leaf_labels: list
      """
  
      # ASCII rendering characters
      JOIN, HLINK, VLINK = "+", "-", "|"
  
      # find the root (or create one)
      if len(self._items) > 1:
          root = _DendrogramNode(self._merge, *self._items)
      else:
          root = self._items[0]
      leaves = self._original_items
  
      if leaf_labels:
          last_row = leaf_labels
      else:
          last_row = ["%s" % leaf._value for leaf in leaves]
  
      # find the bottom row and the best cell width
      width = max(map(len, last_row)) + 1
      lhalf = width // 2
      rhalf = int(width - lhalf - 1)
  
      # display functions
      def format(centre, left=" ", right=" "):
          return f"{lhalf * left}{centre}{right * rhalf}"
  
      def display(str):
          stdout.write(str)
  
      # for each merge, top down
      queue = [(root._value, root)]
      verticals = [format(" ") for leaf in leaves]
      while queue:
          priority, node = queue.pop()
          child_left_leaf = list(
              map(lambda c: c.leaves(False)[0], node._children)
          )
          indices = list(map(leaves.index, child_left_leaf))
          if child_left_leaf:
              min_idx = min(indices)
              max_idx = max(indices)
          for i in range(len(leaves)):
              if leaves[i] in child_left_leaf:
                  if i == min_idx:
                      display(format(JOIN, " ", HLINK))
                  elif i == max_idx:
                      display(format(JOIN, HLINK, " "))
                  else:
                      display(format(JOIN, HLINK, HLINK))
                  verticals[i] = format(VLINK)
              elif min_idx <= i <= max_idx:
                  display(format(HLINK, HLINK, HLINK))
              else:
                  display(verticals[i])
          display("\n")
          for child in node._children:
              if child._children:
                  queue.append((child._value, child))
          queue.sort()
  
          for vertical in verticals:
              display(vertical)
          display("\n")
  
      # finally, display the last line
      display("".join(item.center(width) for item in last_row))
      display("\n")
  
imports: import copy
  from abc import abstractmethod
  from math import sqrt
  from sys import stdout
  from nltk.cluster.api import ClusterI
label_desc: Use image node_id 4 for calling the Dendrogram obj's underlying member method code with example usage: obj.show(leaf_labels) and returns: unknown, centre, unknown