code: def partial_fold(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      mode: int,
      shape: Union[ivy.Shape, ivy.NativeShape, Sequence[int]],
      skip_begin: Optional[int] = 1,
      *,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Re-folds a partially unfolded tensor.
  
      Parameters
      ----------
      x
          a partially unfolded tensor
      mode
          indexing starts at 0, therefore mode is in range(0, tensor.ndim)
      shape
          the shape of the original full tensor (including skipped dimensions)
      skip_begin
          number of dimensions left untouched at the beginning
      out
          optional output array, for writing the result to.
  
      Returns
      -------
      ret
          partially re-folded tensor
      """
      transposed_shape = list(shape)
      mode_dim = transposed_shape.pop(skip_begin + mode)
      transposed_shape.insert(skip_begin, mode_dim)
      return ivy.moveaxis(
          ivy.reshape(x, transposed_shape),
          skip_begin,
          skip_begin + mode,
          out=out,
      )
  
imports: from typing import Optional, Union, Tuple, Iterable, Sequence, Callable, Any, Literal, List
  from numbers import Number
  from functools import partial
  import math
  import ivy
  from ivy.func_wrapper import handle_out_argument, handle_partial_mixed_function, to_native_arrays_and_back, inputs_to_native_shapes, handle_nestable, handle_array_like_without_promotion, handle_view, inputs_to_ivy_arrays, handle_array_function, handle_device, handle_backend_invalid
  from ivy.functional.ivy.general import _numel
  from ivy.utils.backend import current_backend
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 51 for calling a global function with example usage: partial_fold(mode, shape, skip_begin) and returns: ivy