code: def _rescale_to_unit_diagonals(mat):
      """Rescale matrix to have unit diagonals.
  
      Note: Call only after diagonal dominance is ensured.
      """
      d = np.sqrt(np.diag(mat))
      mat /= d
      mat /= d[:, np.newaxis]
      return mat
  
file_path: skggm/inverse_covariance/profiling/graphs.py
imports: import numpy
  import scipy
label_desc: Use image node_id 5 for calling a global function with example usage: _rescale_to_unit_diagonals(mat) and returns: mat