def take_while(self, predicate):
        '''Returns elements from the start while the predicate is True.

        Note: This method uses deferred execution.

        Args:
            predicate: A function returning True or False with which elements
                will be tested.

        Returns:
            A Queryable over the elements from the beginning of the source
            sequence for which predicate is True.

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

        if not is_callable(predicate):
            raise TypeError("take_while() parameter predicate={0} is "
                            "not callable".format(repr(predicate)))

        # Cannot use itertools.takewhile here because it is not lazy
        return self._create(self._generate_take_while_result(predicate))
def take_while ( self , predicate ) : if self . closed ( ) : raise ValueError ( "Attempt to call take_while() on a closed " "Queryable." ) if not is_callable ( predicate ) : raise TypeError ( "take_while() parameter predicate={0} is " "not callable" . format ( repr ( predicate ) ) ) return self . _create ( self . _generate_take_while_result ( predicate ) )
Returns elements from the start while the predicate is True.

        Note: This method uses deferred execution.

        Args:
            predicate: A function returning True or False with which elements
                will be tested.

        Returns:
            A Queryable over the elements from the beginning of the source
            sequence for which predicate is True.

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