def product(product_index=0):
    """Return a selector function for a particular product.

    :param product_index: the index of the desired product in the facility's list
    """
    return lambda facility: facility.products[product_index]