def _recur_strip(s):
    if is_str(s):
        s_tokens = s.split()
        if (eos_token in s_tokens):
            return ' '.join(s_tokens[:s_tokens.index(eos_token)])
        else:
            return s
    else:
        s_ = [_recur_strip(si) for si in s]
        return _maybe_list_to_array(s_, s)
def _recur_strip(s):
    if is_str(s):
        s_tokens = s.split()
        if (eos_token in s_tokens):
            return ' '.join(s_tokens[:s_tokens.index(eos_token)])
        else:
            return s
    else:
        s_ = [_recur_strip(si) for si in s]
        return _maybe_list_to_array(s_, s)