(rl_tuner, action, stat_dict)
return stat_dict
Updates stat dict if a repeated motif was just played.

  Args:
    rl_tuner: An RLTuner object.
    action: One-hot encoding of the chosen action.
    stat_dict: A dictionary containing fields for statistics about
      compositions.
  Returns:
    A dictionary of composition statistics with 'notes_in_repeated_motif'
    field updated.
Updates stat dict if a repeated motif was just played.
Updates stat dict if a repeated motif was just played .
def add_repeated_motif_stat(rl_tuner, action, stat_dict):
  """Updates stat dict if a repeated motif was just played.

  Args:
    rl_tuner: An RLTuner object.
    action: One-hot encoding of the chosen action.
    stat_dict: A dictionary containing fields for statistics about
      compositions.
  Returns:
    A dictionary of composition statistics with 'notes_in_repeated_motif'
    field updated.
  """
  is_repeated, _ = rl_tuner.detect_repeated_motif(action)
  if is_repeated:
    stat_dict['notes_in_repeated_motif'] += 1
  return stat_dict
def add_repeated_motif_stat ( rl_tuner , action , stat_dict ) : is_repeated , _ = rl_tuner . detect_repeated_motif ( action ) if is_repeated : stat_dict [ 'notes_in_repeated_motif' ] += 1 return stat_dict