code: def collect_metrics(buffer_size):
      """Utilitiy to create metrics often used during data collection."""
      metrics = [
          py_metrics.NumberOfEpisodes(),
          py_metrics.EnvironmentSteps(),
          py_metrics.AverageReturnMetric(buffer_size=buffer_size),
          py_metrics.AverageEpisodeLengthMetric(
              buffer_size=buffer_size
          ),
      ]
      return metrics
  
imports: import os
  from absl import logging
  import gin
  import tensorflow.compat.v2
  from tf_agents.drivers import py_driver
  from tf_agents.environments import py_environment
  from tf_agents.environments import tf_environment
  from tf_agents.metrics import py_metrics
  from tf_agents.utils import common
label_desc: Use image node_id 1 for calling a global function with example usage: collect_metrics(buffer_size) and returns: metrics