code: def _true_variance(df, scale):
      """Calculate the true variance in numpy for testing.
  
      Reference implementation, using
      https://en.wikipedia.org/wiki/Folded-t_and_half-t_distributions
  
      Not careful about numerical accuracy. Don't use for large df.
  
      Args:
        df: Positive float.
        scale: float.
  
      Returns:
        The variance for a half normal.
      """
      df = np.array(df)
      scale = np.array(scale)
      return scale**2 * (
          df / (df - 2.0)
          - (4 * df)
          / (np.pi * (df - 1.0) ** 2)
          * (gamma(0.5 * (df + 1)) / gamma(0.5 * df)) ** 2
      )
  
imports: import math
  import numpy
  from scipy import stats
  from scipy.special import gamma
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import half_student_t
  from tensorflow_probability.python.distributions.internal import statistical_testing
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 2 for calling a global function with example usage: _true_variance(df, scale) and returns: unknown