def METHOD_NAME(self, expr):
    """
    Perform a BFS search, returning immediately when a node matches the query.
    Parameters
    ----------
    expr : expr-like
        The searched expression.
    """
    found = self.collection()
    if self.query(expr):
        found.update(self.collection.wrap(expr))
        return found
    for a in self._next(expr):
        found.update(self.METHOD_NAME(a))
    return found