code: def str_join(tokens, sep=" ", compat=True):
      """Concats :attr:`tokens` along the last dimension with intervening
      occurrences of :attr:`sep`.
  
      Args:
          tokens: An `n`-D numpy array or (possibly nested) list of `str`.
          sep (str): The string intervening between the tokens.
          compat (bool): Whether to convert tokens into `unicode` (Python 2)
              or `str` (Python 3).
  
      Returns:
          An `(n-1)`-D numpy array (or list) of `str`.
      """
  
      def _recur_join(s):
          if len(s) == 0:
              return ""
          elif is_str(s[0]):
              return sep.join(s)
          else:
              s_ = [_recur_join(si) for si in s]
              return _maybe_list_to_array(s_, s)
  
      if compat:
          tokens = compat_as_text(tokens)
  
      str_ = _recur_join(tokens)
  
      return str_
  
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 26 for calling a global function with example usage: str_join(tokens, sep, compat) and returns: str_, str, sep, _maybe_list_to_array