code: def get_objects(remove_dups=True, include_frames=False):
      
      gc.collect()
  
      # Do not initialize local variables before calling gc.get_objects or those
      # will be included in the list. Furthermore, ignore frame objects to
      # prevent reference cycles.
      tmp = gc.get_objects()
      tmp = [o for o in tmp if not isframe(o)]
  
      res = []
      for o in tmp:
          # gc.get_objects returns only container objects, but we also want
          # the objects referenced by them
          refs = get_referents(o)
          for ref in refs:
              if not _is_containerobject(ref):
                  # we already got the container objects, now we only add
                  # non-container objects
                  res.append(ref)
      res.extend(tmp)
      if remove_dups:
          res = _remove_duplicates(res)
  
      if include_frames:
          for sf in stack()[2:]:
              res.append(sf[0])
      return res
docs: Return a list of all known objects excluding frame objects.
  
      If (outer) frame objects shall be included, pass `include_frames=True`.  In
      order to prevent building reference cycles, the current frame object (of
      the caller of get_objects) is ignored. This will not prevent creating
      reference cycles if the object list is passed up the call-stack. Therefore,
      frame objects are not included by default.
  
      Keyword arguments:
      remove_dups -- if True, all duplicate objects will be removed.
      include_frames -- if True, includes frame objects.