code: def cumulative_mean_normalized_difference_function(df, n):
      """
      Compute cumulative mean normalized difference function (CMND).
  
      :param df: Difference function
      :param n: length of data
      :return: cumulative mean normalized difference function
      :rtype: list
      """
  
      # scipy method
      cmn_df = df[1:] * range(1, n) / np.cumsum(df[1:]).astype(float)
      return np.insert(cmn_df, 0, 1)
  
file_path: fairseq/examples/speech_synthesis/evaluation/eval_f0.py
imports: import numpy
  import os.path
  import torchaudio
  import tqdm
  from tabulate import tabulate
  from examples.speech_synthesis.utils import gross_pitch_error, voicing_decision_error, f0_frame_error
  from examples.speech_synthesis.evaluation.eval_sp import load_eval_spec
label_desc: Use image node_id 2 for calling a global function with example usage: cumulative_mean_normalized_difference_function(df, n) and returns: np