def str_join(tokens, sep=' ', compat=True):
    'Concats :attr:`tokens` along the last dimension with intervening\n    occurrences of :attr:`sep`.\n\n    Args:\n        tokens: An `n`-D numpy array or (possibly nested) list of `str`.\n        sep (str): The string intervening between the tokens.\n        compat (bool): Whether to convert tokens into `unicode` (Python 2)\n            or `str` (Python 3).\n\n    Returns:\n        An `(n-1)`-D numpy array (or list) of `str`.\n    '

    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_
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 str_join(tokens, sep=' ', compat=True):
    'Concats :attr:`tokens` along the last dimension with intervening\n    occurrences of :attr:`sep`.\n\n    Args:\n        tokens: An `n`-D numpy array or (possibly nested) list of `str`.\n        sep (str): The string intervening between the tokens.\n        compat (bool): Whether to convert tokens into `unicode` (Python 2)\n            or `str` (Python 3).\n\n    Returns:\n        An `(n-1)`-D numpy array (or list) of `str`.\n    '

    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_