code: def K_from_cost(cost, regularization):
      i_dim = cost.shape[0]
      j_dim = cost.shape[1]
      result = np.empty_like(cost)
      for i in numba.prange(i_dim):
          for j in range(j_dim):
              scaled_cost = cost[i, j] / regularization
              result[i, j] = np.exp(-scaled_cost)
  
      return result
  
imports: import numpy
  import numba
  from collections import namedtuple
  from enum import Enum, IntEnum
label_desc: Use image node_id 22 for calling a global function with example usage: K_from_cost(cost, regularization) and returns: result