code: def cov2corr(cov, return_std=False):
      """
      convert covariance matrix to correlation matrix
  
      Parameters
      ----------
      cov : array_like, 2d
          covariance matrix, see Notes
  
      Returns
      -------
      corr : ndarray (subclass)
          correlation matrix
      return_std : bool
          If this is true then the standard deviation is also returned.
          By default only the correlation matrix is returned.
  
      Notes
      -----
      This function does not convert subclasses of ndarrays. This requires that
      division is defined elementwise. np.ma.array and np.matrix are allowed.
      """
      cov = np.asanyarray(cov)
      std_ = np.sqrt(np.diag(cov))
      corr = cov / np.outer(std_, std_)
      if return_std:
          return corr, std_
      else:
          return corr
  
file_path: statsmodels/statsmodels/stats/moment_helpers.py
imports: import numpy
  from scipy.special import comb
label_desc: Use image node_id 12 for calling a global function with example usage: cov2corr(cov, return_std) and returns: corr,  std_, corr