code: def _compute_expected_gradients(
      self, per_example_gradients, l2_norm_clip, num_microbatches
  ):
      batch_size, num_vars = per_example_gradients.shape
      microbatch_gradients = np.mean(
          np.reshape(
              per_example_gradients,
              [
                  num_microbatches,
                  int(batch_size / num_microbatches),
                  num_vars,
              ],
          ),
          axis=1,
      )
      microbatch_gradients_norms = np.linalg.norm(
          microbatch_gradients, axis=1
      )
  
      def scale(x):
          return 1.0 if x < l2_norm_clip else l2_norm_clip / x
  
      scales = np.array(list(map(scale, microbatch_gradients_norms)))
      mean_clipped_gradients = np.mean(
          microbatch_gradients * scales[:, None], axis=0
      )
      return mean_clipped_gradients
  
imports: import os
  import unittest
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow import estimator
  from tensorflow.compat.v1 import estimator
  from tensorflow_privacy.privacy.dp_query import gaussian_query
  from tensorflow_privacy.privacy.optimizers import dp_optimizer
label_desc: Use image node_id 3 for calling the DPOptimizerTest obj's underlying member method code with example usage: obj._compute_expected_gradients(per_example_gradients, l2_norm_clip, num_microbatches) and returns: mean_clipped_gradients, unknown