code: def _softmax(x, add_random_noise=True):
      x_copy = x.copy()
      x_copy[np.isnan(x_copy)] = 0
      x_copy[np.isinf(x_copy)] = 1e12
  
      reduce_dim = x_copy.ndim - 1
      x_minus_max = x_copy - x_copy.max(reduce_dim, keepdims=True)
      x_exp = np.exp(x_minus_max)
      sm = x_exp / x_exp.sum(reduce_dim, keepdims=True)
  
      if add_random_noise:
          sm += np.random.rand(*sm.shape) * 10e-6
      return sm
  
imports: import collections
  import csv
  import os
  import zipfile
  import requests
  import tensorflow
  from adversarial_filtering.bert import modeling
  from adversarial_filtering.bert import tokenization
  import random
  import gcsfs
  import numpy
  from tensorflow.python.lib.io import file_io
label_desc: Use image node_id 2 for calling a global function with example usage: _softmax(x, add_random_noise) and returns: sm