code: def softmax(mat):
      "calc softmax such that labels per time-step form probability distribution"
      # dim0=t, dim1=c
      maxT, _ = mat.shape
      res = np.zeros(mat.shape)
      for t in range(maxT):
          y = mat[t, :]
          maxValue = np.max(y)
          e = np.exp(y - maxValue)
          s = np.sum(e)
          res[t, :] = e / s
  
      return res
  
file_path: calamari/calamari_ocr/thirdparty/ctcwordbeamsearch/DataLoader.py
imports: from __future__ import division
  from __future__ import print_function
  import codecs
  import os.path
  import numpy
  from LanguageModel import LanguageModel
label_desc: Use image node_id 1 for calling a global function with example usage: softmax(mat) and returns: res