code: def flatten(ele):
          
          for el in ele:
              if isinstance(el, list) or isinstance(el, tuple):
                  for e in Models.flatten(el):
                      yield e
              else:
                  yield el
docs: flatten recursively defined list,
              e.g. [1,2,3, [4,5], [6,[8,9,[10,[11,'x']]]]]
  
              :param ele: recursive list, i.e. list in list in list ...
              :return: generator object