code: def tokens(value, analyzer, kwargs):
      if isinstance(value, (tuple, list)):
          gen = entoken(value, **kwargs)
      else:
          gen = analyzer(value, **kwargs)
      return unstopped(gen)
  
imports: from collections import defaultdict
  from whoosh.analysis import unstopped, entoken
  from whoosh.compat import iteritems, dumps, loads, b
  from whoosh.system import emptybytes
  from whoosh.system import _INT_SIZE, _FLOAT_SIZE
  from whoosh.system import pack_uint, unpack_uint, pack_float, unpack_float
label_desc: Use image node_id 1 for calling a global function with example usage: tokens(value, analyzer, kwargs) and returns: unstopped