def apply_shipping_offer(self, basket, method, offer):
        # If the basket has qualified for shipping discount, wrap the shipping
        # method with a decorating class that applies the offer discount to the
        # shipping charge.
        charge = method.calculate(basket)
        if charge.excl_tax == D('0.00'):
            # No need to wrap zero shipping charges
            return method

        if charge.is_tax_known:
            return shipping_methods.TaxInclusiveOfferDiscount(
                method, offer)
        else:
            # When returning a tax exclusive discount, it is assumed
            # that this will be used to calculate taxes which will then
            # be assigned directly to the method instance.
            return shipping_methods.TaxExclusiveOfferDiscount(
                method, offer)
Wrap a shipping method with an offer discount wrapper (as long as the
dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/shipping/repository.py/Repository.apply_shipping_offer