code: def _get_vocab(rows: Iterable[Any], multioutput: bool):
      """Constructs a vocabulary that maps hashables to an integer."""
      if multioutput:
          return {
              k: i
              for i, k in enumerate(
                  set(itertools.chain.from_iterable(rows))
              )
          }
      else:
          return {k: i for i, k in enumerate(set(rows))}
  
imports: from collections.abc import Iterable, Sequence
  import dataclasses
  import enum
  import itertools
  from typing import Any
  import numpy
  from numpy import typing
  from tensorflow_model_analysis.experimental.lazytf import api
label_desc: Use image node_id 7 for calling a global function with example usage: _get_vocab(rows, multioutput) and returns: unknown, unknown