code: def map_ids_to_strs(
      ids,
      vocab,
      join=True,
      strip_pad="<PAD>",
      strip_bos="<BOS>",
      strip_eos="<EOS>",
      compat=True,
  ):
      """Transforms `int` indexes to strings by mapping ids to tokens,
      concatenating tokens into sentences, and stripping special tokens, etc.
  
      Args:
          ids: An n-D numpy array or (possibly nested) list of `int` indexes.
          vocab: An instance of :class:`~texar.tf.data.Vocab`.
          join (bool): Whether to concat along the last dimension of the
              the tokens into a string separated with a space character.
          strip_pad (str): The PAD token to strip from the strings (i.e., remove
              the leading and trailing PAD tokens of the strings). Default
              is '<PAD>' as defined in
              :class:`~texar.tf.data.SpecialTokens`.PAD.
              Set to `None` or `False` to disable the stripping.
          strip_bos (str): The BOS token to strip from the strings (i.e., remove
              the leading BOS tokens of the strings).
              Default is '<BOS>' as defined in
              :class:`~texar.tf.data.SpecialTokens`.BOS.
              Set to `None` or `False` to disable the stripping.
          strip_eos (str): The EOS token to strip from the strings (i.e., remove
              the EOS tokens and all subsequent tokens of the strings).
              Default is '<EOS>' as defined in
              :class:`~texar.tf.data.SpecialTokens`.EOS.
              Set to `None` or `False` to disable the stripping.
  
      Returns:
          If :attr:`join` is True, returns a `(n-1)`-D numpy array (or list) of
          concatenated strings. If :attr:`join` is False, returns an `n`-D numpy
          array (or list) of str tokens.
  
      Example:
  
          .. code-block:: python
  
              text_ids = [[1, 9, 6, 2, 0, 0], [1, 28, 7, 8, 2, 0]]
  
              text = map_ids_to_strs(text_ids, data.vocab)
              # text == ['a sentence', 'parsed from ids']
  
              text = map_ids_to_strs(
                  text_ids, data.vocab, join=False,
                  strip_pad=None, strip_bos=None, strip_eos=None)
              # text == [['<BOS>', 'a', 'sentence', '<EOS>', '<PAD>', '<PAD>'],
              #          ['<BOS>', 'parsed', 'from', 'ids', '<EOS>', '<PAD>']]
      """
      tokens = vocab.map_ids_to_tokens_py(ids)
      if isinstance(ids, (list, tuple)):
          tokens = tokens.tolist()
  
      if compat:
          tokens = compat_as_text(tokens)
  
      str_ = str_join(tokens, compat=False)
  
      str_ = strip_special_tokens(
          str_,
          strip_pad=strip_pad,
          strip_bos=strip_bos,
          strip_eos=strip_eos,
          compat=False,
      )
  
      if join:
          return str_
      else:
          return _recur_split(str_, ids)
  
imports: from typing import List, Union
  import inspect
  import funcsigs
  from pydoc import locate
  import copy
  import collections
  import numpy
  import tensorflow
  from texar.tf.hyperparams import HParams
  from texar.tf.utils.dtypes import is_str, is_callable, compat_as_text, _maybe_list_to_array
label_desc: Use image node_id 27 for calling a global function with example usage: map_ids_to_strs(ids, vocab, join, strip_pad, strip_bos, strip_eos, compat) and returns: str_, _recur_split