code: def _two_d_integration(grid, value_grid):
      """Perform 2-D integration numerically."""
      log_spot_grid, variance_grid = tf.meshgrid(*grid)
      delta_v = variance_grid[1:, :] - variance_grid[:-1, :]
      delta_s = log_spot_grid[:, 1:] - log_spot_grid[:, :-1]
      integral = tf.math.reduce_sum(
          value_grid[0, :-1, :] * delta_v, axis=0
      )
      integral = tf.math.reduce_sum(integral[:-1] * delta_s[0, :])
      return integral
  
imports: import functools
  import numpy
  import tensorflow.compat.v2
  from tf_quant_finance import datetime
  from tf_quant_finance import math
  from tf_quant_finance import utils
  from tf_quant_finance.experimental import local_volatility
  from tf_quant_finance.experimental.pricing_platform.framework.market_data import utils
  from tf_quant_finance.math import pde
  from tf_quant_finance.math.interpolation import linear
  from tf_quant_finance.models import generic_ito_process
label_desc: Use image node_id 3 for calling a global function with example usage: _two_d_integration(grid, value_grid) and returns: integral