code: def to_ivy(
      x: Union[ivy.Array, ivy.NativeArray, Iterable],
      nested: bool = False,
      include_derived: Optional[Dict[str, bool]] = None,
  ) -> Union[ivy.Array, ivy.NativeArray, Iterable]:
      """Return the input array converted to an ivy.Array instance if it is a
      native array type, otherwise the input is returned unchanged. If nested is
      set, the check is applied to all nested leafs of tuples, lists and dicts
      contained within x.
  
      Parameters
      ----------
      x
          The input to be converted.
      nested
          Whether to apply the conversion on arguments in a nested manner. If so, all
          dicts, lists and tuples will be traversed to their lowest leaves in search of
          ivy.Array instances. Default is ``False``.
      include_derived
          Whether to also recursive for classes derived from tuple, list and dict. Default
          is False.
  
      Returns
      -------
      ret
          the input in its native framework form in the case of ivy.Array or instances.
      """
      if nested:
          return ivy.nested_map(
              _to_ivy, x, include_derived, shallow=False
          )
      return _to_ivy(x)
  
file_path: ivy/ivy/data_classes/array/conversions.py
imports: import numpy
  from typing import Any, Union, Tuple, Dict, Iterable, Optional
  import ivy
label_desc: Use image node_id 5 for calling a global function with example usage: to_ivy(x, nested, include_derived) and returns: _to_ivy, ivy