code: def _reshape_boundary_conds(
      raw_coeff,
      trim_from,
      expand_dim_at,
      lower_trim_indices=None,
      upper_trim_indices=None,
  ):
      """Reshapes boundary condition coefficients."""
      # If the coefficient is None, a number or a rank-0 tensor, return as-is.
      if (
          not tf.is_tensor(raw_coeff)
          or len(raw_coeff.shape.as_list()) == 0
      ):  # pylint: disable=g-explicit-length-test
          return raw_coeff
      # See explanation why we trim boundaries and expand dims in places where this
      # function is used.
      coeff = _trim_boundaries(
          raw_coeff,
          trim_from,
          lower_trim_indices=lower_trim_indices,
          upper_trim_indices=upper_trim_indices,
      )
      coeff = tf.expand_dims(coeff, expand_dim_at)
      return coeff
  
imports: import tensorflow.compat.v2
  from tf_quant_finance import utils
label_desc: Use image node_id 18 for calling a global function with example usage: _reshape_boundary_conds(raw_coeff, trim_from, expand_dim_at, lower_trim_indices, upper_trim_indices) and returns: coeff, raw_coeff