code: def _shape_to_native(x: Iterable) -> Tuple[int]:
      # checks the first element of the leaf list and
      # converts it to a native array if it is an ivy array
  
      # This function is to be used with the nested_map function
      # it was a lambda function before but was replaced with the defined function below
      def nested_map_shape_fn(x: Iterable) -> List:
          return x.shape if isinstance(x, ivy.Shape) else x
  
      if (
          isinstance(x, (list, tuple))
          and len(x) != 0
          and isinstance(x[0], (list, tuple))
      ):
          for i, item in enumerate(x):
              x = list(x) if isinstance(x, tuple) else x
              x[i] = _shape_to_native(item)
  
      else:
          if (isinstance(x, (list, tuple)) and len(x) > 0) and (
              isinstance(x[0], ivy.Shape) and ivy.array_mode
          ):
              x = ivy.nested_map(x, nested_map_shape_fn)
          elif isinstance(x, ivy.Shape) and ivy.array_mode:
              x = x.shape
  
      return x
  
imports: from __future__ import annotations
  import functools
  from numbers import Number
  from typing import Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable
  import numpy
  import ivy
  from ivy import to_ivy
  from ivy.utils.exceptions import handle_exceptions
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, infer_dtype, handle_out_argument, outputs_to_ivy_arrays, inputs_to_native_arrays, inputs_to_native_shapes, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid, temp_asarray_wrapper
label_desc: Use image node_id 3 for calling a global function with example usage: _shape_to_native(x) and returns: x, unknown