code: def _updated_cashflows_and_values(
      exercise_value,
      expected_continuation,
      current_cashflow,
      option_values,
  ):
      """Updates optimal cahsflows and option values."""
      zero = tf.constant(0, dtype=current_cashflow.dtype)
      do_update = exercise_value > expected_continuation
      updated_option_values = tf.where(
          do_update, zero, current_cashflow + option_values
      )
      updated_cashflow = tf.where(do_update, exercise_value, zero)
      return updated_cashflow, updated_option_values
  
file_path: tf-quant-finance/tf_quant_finance/models/longstaff_schwartz/lsm.py
imports: from typing import Callable
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
label_desc: Use image node_id 6 for calling a global function with example usage: _updated_cashflows_and_values(exercise_value, expected_continuation, current_cashflow, option_values) and returns: updated_cashflow,  updated_option_values