code: def _check_hierarchy_uses_cluster_more_than_once(Z):
      n = Z.shape[0] + 1
      chosen = set([])
      for i in range(0, n - 1):
          if (
              (Z[i, 0] in chosen)
              or (Z[i, 1] in chosen)
              or Z[i, 0] == Z[i, 1]
          ):
              return True
          chosen.add(Z[i, 0])
          chosen.add(Z[i, 1])
      return False
  
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 27 for calling a global function with example usage: _check_hierarchy_uses_cluster_more_than_once(Z) and returns: False, True