code: def _process_mean_scale(mean, scale_matrix, covariance_matrix, dtype):
      """Extracts correct mean, scale, batch_shape, dimension, and dtype."""
      if scale_matrix is not None:
          scale_matrix = tf.convert_to_tensor(
              scale_matrix, dtype=dtype, name="scale_matrix"
          )
      else:
          if covariance_matrix is not None:
              covariance_matrix = tf.convert_to_tensor(
                  covariance_matrix,
                  dtype=dtype,
                  name="covariance_matrix",
              )
              scale_matrix = tf.linalg.cholesky(covariance_matrix)
      if mean is None:
          mean = 0.0
          # batch_shape includes the dimension of the samples
          batch_shape = tf.shape(scale_matrix)[:-1]
          # TODO(b/182621549): For Sobol sequences, dimension should be known at graph
          # construction time.
          dim = _get_static_dim(scale_matrix)
          dtype = scale_matrix.dtype
      else:
          batch_shape = tf.shape(mean)
          # TODO(b/182621549): For Sobol sequences, dimension should be known at graph
          # construction time.
          dim = _get_static_dim(mean)
          dtype = mean.dtype
      return mean, scale_matrix, batch_shape, dim, dtype
  
file_path: tf-quant-finance/tf_quant_finance/math/random_ops/multivariate_normal.py
imports: import enum
  import numpy
  import tensorflow.compat.v2
  from tf_quant_finance.math.random_ops import halton
  from tf_quant_finance.math.random_ops import sobol
label_desc: Use image node_id 7 for calling a global function with example usage: _process_mean_scale(mean, scale_matrix, covariance_matrix, dtype) and returns: mean,  scale_matrix,  batch_shape,  dim,  dtype