code: def compute_vest_stat(vest_dict, ref_aa, somatic_aa, codon_pos,
                        stat_func=np.mean,
                        default_val=0.0):
      
      # return default value if VEST scores are missing
      if vest_dict is None:
          return default_val
  
      # fetch scores
      myscores = fetch_vest_scores(vest_dict, ref_aa, somatic_aa, codon_pos)
  
      # calculate mean score
      if myscores:
          score_stat = stat_func(myscores)
      else:
          score_stat = default_val
  
      return score_stat
docs: Compute missense VEST score statistic.
  
      Note: non-missense mutations are intentially not filtered out and will take
      a default value of zero.
  
      Parameters
      ----------
      vest_dict : dict
          dictionary containing vest scores across the gene of interest
      ref_aa: list of str
          list of reference amino acids
      somatic_aa: list of str
          somatic mutation aa
      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
          vest score statistic for provided mutation list