def first_or_default(self, default, predicate=None):
        '''The first element (optionally satisfying a predicate) or a default.

        If the predicate is omitted or is None this query returns the first
        element in the sequence; otherwise, it returns the first element in
        the sequence for which the predicate evaluates to True. If there is no
        such element the value of the default argument is returned.

        Note: This method uses immediate execution.

        Args:
            default: The value which will be returned if either the sequence is
                empty or there are no elements matching the predicate.

            predicate: An optional unary predicate function, the only argument
                to which is the element. The return value should be True for
                matching elements, otherwise False.  If the predicate is
                omitted or None the first element of the source sequence will
                be returned.

        Returns:
            The first element of the sequence if predicate is None, otherwise
            the first element for which the predicate returns True. If there is
            no such element, the default argument is returned.

        Raises:
            ValueError: If the Queryable is closed.
            TypeError: If the predicate is not callable.
        '''
        if self.closed():
            raise ValueError("Attempt to call first_or_default() on a "
                             "closed Queryable.")

        return self._first_or_default(default) if predicate is None else self._first_or_default_predicate(default, predicate)
The first element (optionally satisfying a predicate) or a default.

        If the predicate is omitted or is None this query returns the first
        element in the sequence; otherwise, it returns the first element in
        the sequence for which the predicate evaluates to True. If there is no
        such element the value of the default argument is returned.

        Note: This method uses immediate execution.

        Args:
            default: The value which will be returned if either the sequence is
                empty or there are no elements matching the predicate.

            predicate: An optional unary predicate function, the only argument
                to which is the element. The return value should be True for
                matching elements, otherwise False.  If the predicate is
                omitted or None the first element of the source sequence will
                be returned.

        Returns:
            The first element of the sequence if predicate is None, otherwise
            the first element for which the predicate returns True. If there is
            no such element, the default argument is returned.

        Raises:
            ValueError: If the Queryable is closed.
            TypeError: If the predicate is not callable.