code: def flatten(self):
          
  
          def _flatten(d):
              if isinstance(d, dict):
                  for v in d.values():
                      for nested_v in _flatten(v):
                          yield nested_v
              elif isinstance(d, list):
                  for list_v in d:
                      for nested_v in _flatten(list_v):
                          yield nested_v
              else:
                  yield d
  
          return self.__class__(list(_flatten(self.items)))
docs: Get a flattened list of the items in the collection.
  
          :rtype: Collection