code: def flatten(it):
      
      for x in it:
          if isinstance(x, collections.Iterable) and not isinstance(x, str):
              for y in flatten(x):
                  yield y
          else:
              yield x
docs: Flattens any iterable
          From:
          http://stackoverflow.com/questions/11503065/python-function-to-flatten-generator-containing-another-generator
  
      :param it: Iterator, iterator to flatten
      :return: Generator, A generator of the flattened values