code: def is_generator(obj):
      if PY2:
          return hasattr(obj, "next")
      else:
          return hasattr(obj, "__next__")
  
imports: import unittest
  from nose.plugins.attrib import attr
  from nose.tools import *
  from textblob.tokenizers import WordTokenizer, SentenceTokenizer, word_tokenize, sent_tokenize
  from textblob.compat import PY2
label_desc: Use image node_id 1 for calling a global function with example usage: is_generator(obj) and returns: hasattr, hasattr