code: def flatten(struct):
      
      if isinstance(struct, dict):
          return flatten(struct.values())
      elif isinstance(struct, (list, tuple, set)) or is_lazy_iterable(struct):
          objs = []
          for obj in struct:
              objs.extend(flatten(obj))
          return objs
      else:
          return [struct]
docs: Flattens and returns a complex structured object *struct*.