code: def flat_list(lst):
      
      if isinstance(lst, list):
          for item in lst:
              for i in flat_list(item):
                  yield i
      else:
          yield lst
docs: This function flatten given nested list.
      Argument:
          nested list
      Returns:
          flat list