code: def _append_first_and_last(first, inner, last, axis):
      if first is None:
          return _append_last(inner, last, axis=axis)
      if last is None:
          return _append_first(first, inner, axis=axis)
      return tf.concat((first, inner, last), axis=axis)
  
imports: import tensorflow.compat.v2
  from tf_quant_finance import utils
label_desc: Use image node_id 11 for calling a global function with example usage: _append_first_and_last(first, inner, last, axis) and returns: tf, _append_last, _append_first