code: def f(x):
      res = np.zeros_like(x)
      unique, counts = np.unique(x, return_counts=True)
      mapper_dict = {}
      for idx, count in zip(unique, counts):
          mapper_dict[idx] = count
  
      def mp(entry):
          return mapper_dict[entry]
  
      mp = np.vectorize(mp)
      return mp(x)
  
imports: from multiprocessing import Pool
  from tqdm import tqdm
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: f(x) and returns: mp, mapper_dict