code: def estimate_variance(X: np.ndarray) -> float:
      X = shape_into_2d(X)
  
      if X.shape[1] > 1:
          result = det(np.cov(X, rowvar=False))
      else:
          result = np.var(X)
  
      # Extremely small values can somehow result in negative values.
      return max(0.0, result)
  
file_path: dowhy/dowhy/gcm/uncertainty.py
imports: import numpy
  from numpy.linalg import det
  from scipy.special import digamma
  from scipy.stats import entropy
  from sklearn.neighbors import NearestNeighbors
  from dowhy.gcm.constant import EPS
  from dowhy.gcm.util.general import shape_into_2d
label_desc: Use image node_id 4 for calling a global function with example usage: estimate_variance(X) and returns: max