code: def _take_with_axis(
      x: paddle.Tensor,
      indices: paddle.Tensor,
      /,
      *,
      axis: int,
      mode: str,
  ) -> paddle.Tensor:
      # has no checks
      # default behaviour is 'raise' like ON CPU
      # additional check is recommended
  
      x_shape = x.shape[axis]
      if not ivy.exists(axis):
          x = x.flatten()
          x_shape = paddle.prod(paddle.to_tensor(x_shape))
      else:
          x_shape = x.shape[axis]
  
      # wrap
      if mode == "wrap":
          indices = ((indices % x_shape) + x_shape) % x_shape
      # clip
      else:
          indices = paddle.clip(indices, 0, x_shape - 1)
  
      rank = len(x.shape)
      axis = ((axis % rank) + rank) % rank
      slicer = ([slice(None)] * axis) + [indices.tolist()]
      ret = ivy.array(x)[tuple(slicer)]
      if len(indices.shape) == 0 and ret.shape == [1]:
          ret = ret[0]
      return ret
  
imports: from collections import namedtuple
  from typing import Iterable, Optional, Union, Sequence, Tuple, NamedTuple, List, Any, Literal, Callable
  from numbers import Number
  from ..None import backend_version
  from ivy.func_wrapper import with_supported_device_and_dtypes, with_unsupported_device_and_dtypes, with_supported_dtypes, with_unsupported_dtypes
  import paddle
  import ivy
  import ivy.functional.backends.paddle
  from ivy.functional.ivy.experimental.manipulation import _check_paddle_pad, _to_paddle_padding
label_desc: Use image node_id 25 for calling a global function with example usage: _take_with_axis() and returns: ret