code: def NIR_calc(P, POP):
      """
      Calculate No information rate (NIR).
  
      :param P: number of actual positives per class
      :type P: dict
      :param POP: population or total number of samples
      :type POP: int
      :return: NIR as float
      """
      try:
          max_P = max(list(P.values()))
          length = POP
          return max_P / length
      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 18 for calling a global function with example usage: NIR_calc(P, POP) and returns: unknown, str