code: def get_referents(object, level=1):
      
      res = gc.get_referents(object)
      level -= 1
      if level > 0:
          for o in res:
              res.extend(get_referents(o, level))
      res = _remove_duplicates(res)
      return res
docs: Get all referents of an object up to a certain level.
  
      The referents will not be returned in a specific order and
      will not contain duplicate objects. Duplicate objects will be removed.
  
      Keyword arguments:
      level -- level of indirection to which referents considered.
  
      This function is recursive.