code: def _to_nested_tuple(nested_list):
      ret = ()
      if hasattr(nested_list, "__iter__"):
          for inner_list in nested_list:
              if hasattr(inner_list, "__iter__"):
                  ret += (tuple(inner_list),)
              else:
                  ret += (inner_list,)
          return ret
      if ret == ():
          return nested_list
  
imports: from typing import Iterable, Optional, Union, Sequence, Tuple, NamedTuple, Literal, Callable, Any, List
  import jax.numpy
  import jax.lax
  from numbers import Number
  from collections import namedtuple
  import ivy
  from ivy.functional.backends.jax import JaxArray
label_desc: Use image node_id 11 for calling a global function with example usage: _to_nested_tuple(nested_list) and returns: ret, nested_list