code: def p_value_calc(TP, POP, NIR):
      """
      Calculate p_value.
  
      :param TP: true positive
      :type TP: dict
      :param POP: population or total number of samples
      :type POP: int
      :param NIR: no information rate
      :type NIR: float
      :return: p_value as float
      """
      try:
          n = POP
          x = sum(list(TP.values()))
          p = NIR
          result = 0
          for j in range(x):
              result += ncr(n, j) * (p**j) * ((1 - p) ** (n - j))
          return 1 - result
      except Exception:
          return "None"
  
imports: from __future__ import division
  import math
  import operator
  from functools import reduce
  from .pycm_interpret import *
  from .pycm_ci import kappa_SE_calc, CI_calc, SE_calc
  from .pycm_util import complement
label_desc: Use image node_id 17 for calling a global function with example usage: p_value_calc(TP, POP, NIR) and returns: unknown, str