code: def _append_nonsingleton_leaf_node(
      Z,
      p,
      n,
      level,
      lvs,
      ivl,
      leaf_label_func,
      i,
      labels,
      show_leaf_counts,
  ):
      # If the leaf id structure is not None and is a list then the caller
      # to dendrogram has indicated that cluster id's corresponding to the
      # leaf nodes should be recorded.
  
      if lvs is not None:
          lvs.append(int(i))
      if ivl is not None:
          if leaf_label_func:
              ivl.append(leaf_label_func(int(i)))
          else:
              if show_leaf_counts:
                  ivl.append("(" + str(int(Z[i - n, 3])) + ")")
              else:
                  ivl.append("")
  
imports: import warnings
  import bisect
  from collections import deque
  import numpy
  from .None import _hierarchy, _optimal_leaf_ordering
  import scipy.spatial.distance
  from scipy._lib._disjoint_set import DisjointSet
label_desc: Use image node_id 42 for calling a global function with example usage: _append_nonsingleton_leaf_node(Z, p, n, level, lvs, ivl, leaf_label_func, i, labels, show_leaf_counts) without return types