code: def hamming_calc(TP, POP):
      
      try:
          length = POP
          return (1 / length) * (length - sum(TP.values()))
      except Exception:
          return "None"
docs: Calculate hamming loss.
  
      :param TP: true positive
      :type TP : dict
      :param POP: population
      :type POP : int
      :return: hamming loss as float