code: def compute_composition_stats(
      rl_tuner,
      num_compositions=10000,
      composition_length=32,
      key=None,
      tonic_note=rl_tuner_ops.C_MAJOR_TONIC,
  ):
      """Uses the model to create many compositions, stores statistics about them.
  
      Args:
        rl_tuner: An RLTuner object.
        num_compositions: The number of compositions to create.
        composition_length: The number of beats in each composition.
        key: The numeric values of notes belonging to this key. Defaults to
          C-major if not provided.
        tonic_note: The tonic/1st note of the desired key.
      Returns:
        A dictionary containing the computed statistics about the compositions.
      """
      stat_dict = initialize_stat_dict()
  
      for i in range(num_compositions):
          stat_dict = compose_and_evaluate_piece(
              rl_tuner,
              stat_dict,
              composition_length=composition_length,
              key=key,
              tonic_note=tonic_note,
          )
          if i % (num_compositions / 10) == 0:
              stat_dict["num_compositions"] = i
              stat_dict["total_notes"] = i * composition_length
  
      stat_dict["num_compositions"] = num_compositions
      stat_dict["total_notes"] = num_compositions * composition_length
  
      tf.logging.info(get_stat_dict_string(stat_dict))
  
      return stat_dict
  
file_path: magenta/magenta/models/rl_tuner/rl_tuner_eval_metrics.py
imports: from magenta.models.rl_tuner import rl_tuner_ops
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: compute_composition_stats(rl_tuner, num_compositions, composition_length, key, tonic_note) and returns: stat_dict