code: def covariance_multinomial_probability_distribution(entries):
      """Calculate covariance matrix of a single multinomial probability distribution
  
      :param entries: entries of input histogram
      :return: numpy 2D array with covariance matrix of multinomial probability distribution
      """
      n_bins = len(entries)
      n_entries = np.sum(entries)
      prob = entries / n_entries
  
      covariance_matrix = np.zeros((n_bins, n_bins))
  
      for i in range(n_bins):
          for j in range(i, n_bins):
              if i == j:
                  covariance_matrix[i][j] = (
                      prob[i] * (1 - prob[i])
                  ) / n_entries
              else:
                  covariance_matrix[i][j] = (
                      -(prob[i] * prob[j]) / n_entries
                  )
                  covariance_matrix[j][i] = covariance_matrix[i][j]
  
      return covariance_matrix
  
file_path: popmon/popmon/stats/numpy.py
imports: import numpy
  import pandas
label_desc: Use image node_id 6 for calling a global function with example usage: covariance_multinomial_probability_distribution(entries) and returns: covariance_matrix