code: def search(self, cond):
          
  
          if cond in self._query_cache:
              return self._query_cache.get(cond, [])[:]
  
          docs = [doc for doc in self.all() if cond(doc)]
          self._query_cache[cond] = docs
  
          return docs[:]
docs: Search for all documents matching a 'where' cond.
  
          :param cond: the condition to check against
          :type cond: Query
  
          :returns: list of matching documents
          :rtype: list[Element]