code: def meshgrid(
      *arrays: Union[tf.Tensor, tf.Variable],
      sparse: bool = False,
      indexing: str = "xy",
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> List[Union[tf.Tensor, tf.Variable]]:
      if not sparse:
          return tf.meshgrid(*arrays, indexing=indexing)
  
      sd = (1,) * len(arrays)
      res = [
          tf.reshape(
              tf.convert_to_tensor(a), (sd[:i] + (-1,) + sd[i + 1 :])
          )
          for i, a in enumerate(arrays)
      ]
  
      if indexing == "xy" and len(arrays) > 1:
          res[0] = tf.reshape(res[0], (1, -1) + sd[2:])
          res[1] = tf.reshape(res[1], (-1, 1) + sd[2:])
  
      return res
  
imports: import numpy
  from numbers import Number
  from typing import Union, List, Optional, Sequence, Tuple
  import tensorflow
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.ivy.creation import _asarray_to_native_arrays_and_back, _asarray_infer_device, _asarray_infer_dtype, _asarray_handle_nestable, NestedSequence, SupportsBufferProtocol, _asarray_inputs_to_native_shapes
  from .None import backend_version
label_desc: Use image node_id 12 for calling a global function with example usage: meshgrid() and returns: res, tf