code: def _remove_default_boundary(
      lower_trim_indices,
      upper_trim_indices,
      has_default_lower_boundary,
      has_default_upper_boundary,
      batch_rank,
      dims,
      n_dims,
  ):
      """Creates trim indices that correspond to an inner grid with Robin BC."""
      # For a sequence of `dims` we shift lower trims by one upward, if that lower
      # bound is default; and upper trims by one downward, if that upper bound is
      # default. For each dimension we compute paddings
      # `[[lower_i, upper_i] for i in range(n_dims)]`
      # with `lower_i` and `upper_i`  being 0 or 1 to indicate whether the lower
      # or upper indices were updated.
      # For example,  _remove_default_boundary(
      #                   [0, 1], [-1, 0],
      #                   [True, False], [False, True], 0, (1, ), 2)
      # returns a tuple ([0, 1], [-1, -1], [[0, 0], [0, 1]]) so that only the
      # upper index of the second dimension was changed.
      trimmed_lower_indices = []
      trimmed_upper_indices = []
      paddings = batch_rank * [[0, 0]]
      for dim in range(n_dims):
          update_lower = has_default_lower_boundary[dim] and dim in dims
          update_upper = has_default_upper_boundary[dim] and dim in dims
          trim_lower = 1 if update_lower else 0
          trimmed_lower_indices.append(
              lower_trim_indices[dim] + trim_lower
          )
          trim_upper = 1 if update_upper else 0
          trimmed_upper_indices.append(
              upper_trim_indices[dim] - trim_upper
          )
          paddings.append([trim_lower, trim_upper])
      return trimmed_lower_indices, trimmed_upper_indices, paddings
  
imports: import tensorflow.compat.v2
  from tf_quant_finance import utils
label_desc: Use image node_id 21 for calling a global function with example usage: _remove_default_boundary(lower_trim_indices, upper_trim_indices, has_default_lower_boundary, has_default_upper_boundary, batch_rank, dims, n_dims) and returns: trimmed_lower_indices,  trimmed_upper_indices,  paddings