code: def PC_PI_calc(P, TOP, POP):
      
      try:
          result = 0
          for i in P.keys():
              result += ((P[i] + TOP[i]) / (2 * POP[i]))**2
          return result
      except Exception:
          return "None"
docs: Calculate percent chance agreement for Scott's Pi.
  
      :param P: condition positive
      :type P : dict
      :param TOP: test outcome positive
      :type TOP : dict
      :param POP: population
      :type POP:dict
      :return: percent chance agreement as float