@property
    def first(self):
        """
        Return a Query that selects only the first element of this Query.
        If no elements are available, returns a query with no results.

        Example usage:

        .. code:: python

            >> q = Query(lambda: range(5))
            >> q.first.results
            [0]

        Returns:
            Query
        """
        def _transform(xs):  # pylint: disable=missing-docstring, invalid-name
            try:
                return [iter(xs).next()]
            except __HOLE__:
                return []

        return self.transform(_transform, 'first')
dataset/ETHPy150Open edx/bok-choy/bok_choy/query.py/Query.first