code: def exponential_decay(value, max_val, half_life):
      """Compute decay factor for a given value based on an exponential decay.
  
      Values greater than `max_val` will be set to 1.
  
      Args:
          value (numeric): Value to calculate decay factor
          max_val (numeric): Value at which decay factor will be 1
          half_life (numeric): Value at which decay factor will be 0.5
  
      Returns:
          float: Decay factor
      """
      return np.minimum(
          1.0, np.power(0.5, (max_val - value) / half_life)
      )
  
file_path: recommenders/recommenders/utils/python_utils.py
imports: import logging
  import numpy
  from scipy import sparse
label_desc: Use image node_id 1 for calling a global function with example usage: exponential_decay(value, max_val, half_life) and returns: np