code: def calculate_sample_paths_mean_and_variance(
      test_obj,
      mu,
      sigma,
      times,
      initial_state,
      supply_draws,
      num_samples,
      dtype,
  ):
      """Returns the mean and variance of the log of the sample paths for a process.
  
      Generates a set of sample paths for a univariate geometric brownian motion
      and calculates the mean and variance of the log of the paths. Also returns the
      standard error of the mean and variance.
  
      Args:
        test_obj: An object which has the `evaluate` method. Used to evaluate `a` if
          `a` is a Tensor.
        mu: Scalar real `Tensor` broadcastable to [`batch_shape`] or an instance
          of left-continuous `PiecewiseConstantFunc` of [`batch_shape`]
          dimensions. Where `batch_shape` is the larger of `mu.shape` and
          `sigma.shape`. Corresponds to the mean drift of the Ito process.
        sigma: Scalar real `Tensor` broadcastable to [`batch_shape`] or an
          instance of left-continuous `PiecewiseConstantFunc` of the same `dtype`
          and `batch_shape` as set by `mu`. Where `batch_shape` is the larger of
          `mu.shape` and `sigma.shape`. Corresponds to the volatility of the
          process and should be positive.
        times: Rank 1 `Tensor` of positive real values. The times at which the
          path points are to be evaluated.
        initial_state: A `Tensor` of the same `dtype` as `times` and of shape
          broadcastable to `[batch_shape, num_samples]`. Represents the initial
          state of the Ito process.
        supply_draws: Boolean set to true if the `normal_draws` should be generated
          and then passed to the pricing function.
        num_samples: Positive scalar `int`. The number of paths to draw.
        dtype: The default dtype to use when converting values to `Tensor`s.
  
      Returns:
        A tuple of (mean, variance, standard_error of the mean,
          standard_error of the variance).
      """
      # TODO(b/177990397): This function should be independent of the test framework
      samples = generate_sample_paths(
          mu,
          sigma,
          times,
          initial_state,
          supply_draws,
          num_samples,
          dtype,
      )
      return test_obj.evaluate(
          calculate_mean_and_variance_from_sample_paths(
              samples, num_samples, dtype
          )
      )
  
file_path: tf-quant-finance/tf_quant_finance/models/geometric_brownian_motion/geometric_brownian_motion_test_utils.py
imports: import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
label_desc: Use image node_id 5 for calling a global function with example usage: calculate_sample_paths_mean_and_variance(test_obj, mu, sigma, times, initial_state, supply_draws, num_samples, dtype) and returns: test_obj