def get_customer_tax_rate(request, product):
    """Returns the specfic customer tax for the current customer and product.
    """
    cache_key = 'cached_customer_tax_rate_%s' % product.pk
    if request and hasattr(request, cache_key):
        return getattr(request, cache_key)
    customer_tax = get_first_valid(request, CustomerTax.objects.all(), product)
    if customer_tax:
        taxrate = customer_tax.rate
    else:
        taxrate = _calc_product_tax_rate(request, product)
    if request:
        setattr(request, cache_key, taxrate)
    return taxrate
dataset/ETHPy150Open diefenbach/django-lfs/lfs/customer_tax/utils.py/get_customer_tax_rate/original