code: def AGM_calc(TPR, TNR, GM, N, POP):
      """
      Calculate Adjusted geometric mean (AGM).
  
      :param TNR: specificity or true negative rate
      :type TNR: float
      :param TPR: sensitivity, recall, hit rate, or true positive rate
      :type TPR: float
      :param GM: geometric mean
      :type GM: float
      :param N: number of actual negatives
      :type N: int
      :param POP: population or total number of samples
      :type POP: int
      :return: AGM as float
      """
      try:
          n = N / POP
          if TPR == 0:
              result = 0
          else:
              result = (GM + TNR * n) / (1 + n)
          return result
      except (ZeroDivisionError, TypeError):
          return "None"
  
imports: from __future__ import division
  import math
  from .pycm_util import normal_quantile
  from .pycm_interpret import *
  from .pycm_param import CLASS_PARAMS
label_desc: Use image node_id 8 for calling a global function with example usage: AGM_calc(TPR, TNR, GM, N, POP) and returns: result, str