def element_at(index):
    """Create a transducer which obtains the item at the specified index."""

    if index < 0:
        raise IndexError("element_at used with illegal index {}".format(index))

    def element_at_transducer(reducer):
        return ElementAt(reducer, index)

    return element_at_transducer
Create a transducer which obtains the item at the specified index.