parameters: (arr, pad_args, mode)
return_statement: return arr
docstring: handle pads after the array
docstring_summary: handle pads after the array
docstring_tokens: handle pads after the array
function: def _add_pads_after(arr, pad_args, mode):
      """handle pads after the array"""
      idx, array_length, times_to_pad_after, additional_pad_after, reflect_type = pad_args
      curr_pad = None
      endpoint_adder = None
      edge_end = _slice_along_axis(arr, idx, arr.shape[idx]-1, arr.shape[idx])
      if mode == "reflect":
          endpoint_adder = 1
      else:
          endpoint_adder = 0
      # Deal with paddings after the original array
      for times in range(times_to_pad_after):
          if times < times_to_pad_after - 1:
              startpoint = arr.shape[idx] - array_length
          else:
              startpoint = arr.shape[idx] - additional_pad_after - endpoint_adder
          if startpoint != arr.shape[idx] - endpoint_adder:
              curr_pad = _slice_along_axis(arr, idx, startpoint, arr.shape[idx] - endpoint_adder)
              curr_pad = flip(curr_pad, axis=idx)
              if reflect_type == "odd":
                  curr_pad = 2 * edge_end - curr_pad
              arr = P.Concat(idx)((arr, curr_pad))
              edge_end = _slice_along_axis(arr, idx, arr.shape[idx]-1, arr.shape[idx])
      return arr
function_tokens: def _add_pads_after ( arr , pad_args , mode ) : idx , array_length , times_to_pad_after , additional_pad_after , reflect_type = pad_args curr_pad = None endpoint_adder = None edge_end = _slice_along_axis ( arr , idx , arr . shape [ idx ] - 1 , arr . shape [ idx ] ) if mode == "reflect" : endpoint_adder = 1 else : endpoint_adder = 0 # Deal with paddings after the original array for times in range ( times_to_pad_after ) : if times < times_to_pad_after - 1 : startpoint = arr . shape [ idx ] - array_length else : startpoint = arr . shape [ idx ] - additional_pad_after - endpoint_adder if startpoint != arr . shape [ idx ] - endpoint_adder : curr_pad = _slice_along_axis ( arr , idx , startpoint , arr . shape [ idx ] - endpoint_adder ) curr_pad = flip ( curr_pad , axis = idx ) if reflect_type == "odd" : curr_pad = 2 * edge_end - curr_pad arr = P . Concat ( idx ) ( ( arr , curr_pad ) ) edge_end = _slice_along_axis ( arr , idx , arr . shape [ idx ] - 1 , arr . shape [ idx ] ) return arr