code: def compute_multinomial_mode(probs, total_count=1, seed=None):
      """Compute the mode of a Multinomial random variable.
  
      Args:
        probs: 1-D Numpy array of Multinomial class probabilities
        total_count: integer number of trials in single Multinomial draw
        seed: a Python integer. Used to create a random seed for the
          distribution
  
      #### Examples
  
      ```python
      # returns either [2, 2, 1], [2, 1, 2] or [1, 2, 2]
      probs = np.array(3 * [1/3])
      total_count = 5
      compute_multinomial_mode(probs, total_count)
  
      # returns [3, 2, 0]
      probs = np.array(3 * [1/3])
      total_count = 5
      compute_multinomial_mode(probs, total_count)
      ```
      """
  
      def softmax(vec):
          numerator = np.exp(vec)
          return numerator / numerator.sum(axis=0)
  
      random_state = np.random.RandomState(seed)
      mode = np.zeros_like(probs, dtype=np.int32)
      if total_count == 1:
          mode[np.argmax(probs)] += 1
          return list(mode)
      remaining_count = total_count
      uniform_prob = 1 / total_count
  
      while remaining_count > 0:
          if (probs < uniform_prob).all():
              probs = softmax(probs)
          mask = probs >= uniform_prob
          overflow_count = int(mask.sum() - remaining_count)
          if overflow_count > 0:
              hot_indices = np.where(mask)[0]
              cold_indices = random_state.choice(
                  hot_indices, overflow_count, replace=False
              )
              mask[cold_indices] = False
          mode[mask] += 1
          probs[mask] -= uniform_prob
          remaining_count -= np.sum(mask)
      return mode
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  import tensorflow
  from copy import deepcopy
  from edward.models.random_variable import RandomVariable
  from edward.models.random_variables import TransformedDistribution
  from edward.models import PointMass
  from edward.util.graphs import random_variables
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.python.framework.ops import set_shapes_for_outputs
  from tensorflow.python.util import compat
label_desc: Use image node_id 16 for calling a global function with example usage: compute_multinomial_mode(probs, total_count, seed) and returns: mode, unknown, list