code: def compute_mga_entropy_stat(mga_vec, codon_pos,
                               stat_func=np.mean,
                               default_val=0.0):
      
      # return default value if VEST scores are missing
      if mga_vec is None:
          return default_val
  
      # fetch scores
      myscores = fetch_mga_scores(mga_vec, codon_pos)
  
      # calculate mean score
      if myscores is not None and len(myscores):
          score_stat = stat_func(myscores)
      else:
          score_stat = default_val
  
      return score_stat
docs: Compute MGA entropy conservation statistic
  
      Parameters
      ----------
      mga_vec : np.array
          numpy vector containing MGA Entropy conservation scores for residues
      codon_pos : list of int
          position of codon in protein sequence
      stat_func : function, default=np.mean
          function that calculates a statistic
      default_val : float
          default value to return if there are no mutations
  
      Returns
      -------
      score_stat : float
          MGA entropy score statistic for provided mutation list