code: def _price(
      spot_mkt,
      vol_mkt,
      rate_mkt,
      underliers,
      strikes,
      call_put_flag,
      expiry_ordinals,
  ):
      """Prices the options."""
      # Get mkt data for each option
      spots = tf.gather(spot_mkt, underliers)
      vols = tf.gather(vol_mkt, underliers)
      rates = tf.gather(rate_mkt, underliers)
      # Convert expiries into time.
      expiry_ordinals = tf.cast(expiry_ordinals, dtype=tf.int32)
      expiry_dates = tff.datetime.dates_from_ordinals(expiry_ordinals)
      pricing_date = tff.datetime.dates_from_datetimes(
          [datetime.date.today()]
      )
      expiry_times = tff.datetime.daycount_actual_360(
          start_date=pricing_date,
          end_date=expiry_dates,
          dtype=np.float64,
      )
      prices = tff.black_scholes.option_price(
          volatilities=vols,
          strikes=strikes,
          expiries=expiry_times,
          spots=spots,
          discount_rates=rates,
          is_call_options=call_put_flag,
      )
      return prices
  
file_path: tf-quant-finance/tf_quant_finance/examples/demos/option_pricing_basic/pricer/app/pricers.py
imports: import datetime
  import time
  import numpy
  import tensorflow
  import tf_quant_finance
label_desc: Use image node_id 1 for calling a global function with example usage: _price(spot_mkt, vol_mkt, rate_mkt, underliers, strikes, call_put_flag, expiry_ordinals) and returns: prices