code: def _apply_default_boundary(
      subdiag,
      diag,
      superdiag,
      zeroth_order_coeff,
      inner_first_order_coeff,
      first_order_coeff,
      forward_deltas,
      backward_deltas,
      has_default_lower_boundary,
      has_default_upper_boundary,
  ):
      """Update discretization matrix for default boundary conditions."""
      # For default BC, we need to add spatial discretizations of
      # 'b * d(B * V)/dx + c * V' to the boundaries
  
      # Extract batch shape
      batch_shape = utils.get_shape(diag)[:-1]
      # Set zero coeff if it is None
      if zeroth_order_coeff is None:
          zeroth_order_coeff = tf.zeros([1], dtype=diag.dtype)
      # Updates for lower BC
      if has_default_lower_boundary:
          (subdiag, diag, superdiag) = _apply_default_lower_boundary(
              subdiag,
              diag,
              superdiag,
              zeroth_order_coeff,
              inner_first_order_coeff,
              first_order_coeff,
              forward_deltas,
              batch_shape,
          )
  
      # Updates for upper BC
      if has_default_upper_boundary:
          (subdiag, diag, superdiag) = _apply_default_upper_boundary(
              subdiag,
              diag,
              superdiag,
              zeroth_order_coeff,
              inner_first_order_coeff,
              first_order_coeff,
              backward_deltas,
              batch_shape,
          )
      return subdiag, diag, superdiag
  
file_path: tf-quant-finance/tf_quant_finance/math/pde/steppers/parabolic_equation_stepper.py
imports: import tensorflow.compat.v2
  from tf_quant_finance import utils
label_desc: Use image node_id 3 for calling a global function with example usage: _apply_default_boundary(subdiag, diag, superdiag, zeroth_order_coeff, inner_first_order_coeff, first_order_coeff, forward_deltas, backward_deltas, has_default_lower_boundary, has_default_upper_boundary) and returns: subdiag,  diag,  superdiag