class_docstr: Tests for methods for the vanilla pricing module.
class_docstr_tok: ["Tests","for","methods","for","the","vanilla","pricing","module","."]
docstr: Tests that zero expiry is correctly handled.
docstr_tok: ["Tests","that","zero","expiry","is","correctly","handled","."]
code: def test_price_zero_expiry(self):
      """Tests that zero expiry is correctly handled."""
      # If the expiry is zero, the option's value should be correct.
      forwards = np.array([1.0, 1.0, 1.0, 1.0])
      strikes = np.array([1.1, 0.9, 1.1, 0.9])
      volatilities = np.array([0.1, 0.2, 0.5, 0.9])
      expiries = 0.0
      is_call_options = np.array([True, True, False, False])
      expected_prices = np.array([0.0, 0.1, 0.1, 0.0])
      computed_prices = self.evaluate(
          tff.black_scholes.option_price(
              volatilities=volatilities,
              strikes=strikes,
              expiries=expiries,
              forwards=forwards,
              is_call_options=is_call_options,
          )
      )
      self.assertArrayNear(expected_prices, computed_prices, 1e-10)
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tensorflow_probability
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 4 for calling the VanillaPrice obj's underlying member method code with example usage: obj.test_price_zero_expiry() without return types