code: def softmax(df):
      if len(df.shape) == 1:
          df[df > 20] = 20
          df[df < -20] = -20
          ppositive = 1 / (1 + np.exp(-df))
          ppositive[ppositive > 0.999999] = 1
          ppositive[ppositive < 0.0000001] = 0
          return np.transpose(np.array((1 - ppositive, ppositive)))
      else:
          # Compute the Softmax like it is described here:
          # https://www.deeplearningbook.org/contents/numerical.html
          tmp = df - np.max(df, axis=1).reshape((-1, 1))
          tmp = np.exp(tmp)
          return tmp / np.sum(tmp, axis=1).reshape((-1, 1))
  
label_desc: Use image node_id 1 for calling a global function with example usage: softmax(df) and returns: np, unknown