code: def random_stats(self, all_stats, race, ch_class):
          
          
          # create blank list of stats to be generated
          stats = []
          res = {}
          for s in all_stats:
              stats.append(s['stat'])
              res[s['stat']] = 0
          
          cur_stat = 0
          for stat in stats:
              for ndx, i in enumerate(self.classes.dat):
                  if i['name'] == ch_class:
                      cur_stat = int(i[stat])  # use stats for this class as baseline
              for ndx, i in enumerate(self.races.dat):
                  if i['name'] == race:
                      cur_stat += int(i[stat])  # use stats for this race to modify base stats
              #print(stat, cur_stat)
              if cur_stat < 1:
                  cur_stat = 1
              elif cur_stat > 10:
                  if stat not in ('Health', 'max_health'): # dont trim down health
                      cur_stat = 10
             
              res[stat] = cur_stat
          
          return res
docs: create random stats based on the characters class and race
          This looks up the tables from CharacterCollection to get
          base stats and applies a close random fit