code: def q_explained_variance(q_pred, q_true):
      """
      Calculates the explained variance of the Q value
  
      :param q_pred: (TensorFlow Tensor) The predicted Q value
      :param q_true: (TensorFlow Tensor) The expected Q value
      :return: (TensorFlow Tensor) the explained variance of the Q value
      """
      _, var_y = tf.nn.moments(q_true, axes=[0, 1])
      _, var_pred = tf.nn.moments(q_true - q_pred, axes=[0, 1])
      check_shape([var_y, var_pred], [[]] * 2)
      return 1.0 - (var_pred / var_y)
  
imports: import os
  import collections
  import functools
  import multiprocessing
  from typing import Set
  import numpy
  import tensorflow
label_desc: Use image node_id 11 for calling a global function with example usage: q_explained_variance(q_pred, q_true) and returns: unknown