code: def nanvar(
      a,
      axis=None,
      dtype=None,
      out=None,
      ddof=0,
      keepdims=False,
      *,
      where=True,
  ):
      is_nan = ivy.isnan(a)
      if dtype is None:
          dtype = "float16" if ivy.is_int_dtype(a) else a.dtype
      if ivy.any(is_nan):
          a = [i for i in a if ivy.isnan(i) is False]
  
      if dtype:
          a = ivy.astype(ivy.array(a), ivy.as_ivy_dtype(dtype))
  
      ret = ivy.var(
          a, axis=axis, correction=ddof, keepdims=keepdims, out=out
      )
      if ivy.is_array(where):
          where = ivy.array(where, dtype=ivy.bool)
          ret = ivy.where(
              where, ret, ivy.default(out, ivy.zeros_like(ret)), out=out
          )
  
      all_nan = ivy.isnan(ret)
      if ivy.all(all_nan):
          ret = ivy.astype(ret, ivy.array([float("inf")]))
      return ret
  
imports: import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.frontends.jax.func_wrapper import to_ivy_arrays_and_back, handle_jax_dtype
  from ivy.functional.frontends.jax.numpy import promote_types_of_jax_inputs
  from ivy.functional.backends.jax.experimental.elementwise import _normalize_axis_tuple
label_desc: Use image node_id 22 for calling a global function with example usage: nanvar(a, axis, dtype, out, ddof, keepdims) and returns: ret