def METHOD_NAME(price: TaxedMoney) -> Decimal:
    """Calculate the tax rate as percentage value from given price.
    Requires a TaxedMoney instance with net and gross amounts set.
    """
    tax_rate = Decimal("0.0")
    # The condition will return False when unit_price.gross or unit_price.net is 0.0
    if not isinstance(price, Decimal) and all((price.gross, price.net)):
        tax_rate = price.tax / price.net
    return tax_rate