code: def _extract_list_from_generator(generator):
      
  
      extracted = []
      for i in generator:
          extracted.append(list(i))
      return extracted
docs: Iterates over a generator to extract all the objects and add them to a list.
      Useful when the objects have to be used multiple times.