code: def _randdm(pnts):
      """
      Generate a random distance matrix stored in condensed form.
  
      Parameters
      ----------
      pnts : int
          The number of points in the distance matrix. Has to be at least 2.
  
      Returns
      -------
      D : ndarray
          A ``pnts * (pnts - 1) / 2`` sized vector is returned.
      """
      if pnts >= 2:
          D = np.random.rand(pnts * (pnts - 1) / 2)
      else:
          raise ValueError(
              "The number of points in the distance matrix "
              "must be at least 2."
          )
      return D
  
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 4 for calling a global function with example usage: _randdm(pnts) and returns: D