code: def _var(
      a,
      axis=None,
      dtype=None,
      out=None,
      ddof=0,
      keepdims=False,
      *,
      where=True,
  ):
      arr = asanyarray(a)
  
      rcount = _count_reduce_items(
          arr, axis, keepdims=keepdims, where=where
      )
      # Make this warning show up on top.
      if (
          ddof >= rcount
          if where is True
          else umr_any(ddof >= rcount, axis=None)
      ):
          warnings.warn(
              "Degrees of freedom <= 0 for slice",
              RuntimeWarning,
              stacklevel=2,
          )
  
      # Cast bool, unsigned int, and int to float64 by default
      if dtype is None and issubclass(
          arr.dtype.type, (nt.integer, nt.bool_)
      ):
          dtype = mu.dtype("f8")
  
      # Compute the mean.
      # Note that if dtype is not of inexact type then arraymean will
      # not be either.
      arrmean = umr_sum(arr, axis, dtype, keepdims=True, where=where)
      # The shape of rcount has to match arrmean to not change the shape of out
      # in broadcasting. Otherwise, it cannot be stored back to arrmean.
      if rcount.ndim == 0:
          # fast-path for default case when where is True
          div = rcount
      else:
          # matching rcount to arrmean when where is specified as array
          div = rcount.reshape(arrmean.shape)
      if isinstance(arrmean, mu.ndarray):
          with _no_nep50_warning():
              arrmean = um.true_divide(
                  arrmean,
                  div,
                  out=arrmean,
                  casting="unsafe",
                  subok=False,
              )
      elif hasattr(arrmean, "dtype"):
          arrmean = arrmean.dtype.type(arrmean / rcount)
      else:
          arrmean = arrmean / rcount
  
      # Compute sum of squared deviations from mean
      # Note that x may not be inexact and that we need it to be an array,
      # not a scalar.
      x = asanyarray(arr - arrmean)
  
      if issubclass(arr.dtype.type, (nt.floating, nt.integer)):
          x = um.multiply(x, x, out=x)
      # Fast-paths for built-in complex types
      elif x.dtype in _complex_to_float:
          xv = x.view(dtype=(_complex_to_float[x.dtype], (2,)))
          um.multiply(xv, xv, out=xv)
          x = um.add(xv[..., 0], xv[..., 1], out=x.real).real
      # Most general case; includes handling object arrays containing imaginary
      # numbers and complex types with non-native byteorder
      else:
          x = um.multiply(x, um.conjugate(x), out=x).real
  
      ret = umr_sum(x, axis, dtype, out, keepdims=keepdims, where=where)
  
      # Compute degrees of freedom and make sure it is not negative.
      rcount = um.maximum(rcount - ddof, 0)
  
      # divide by degrees of freedom
      if isinstance(ret, mu.ndarray):
          with _no_nep50_warning():
              ret = um.true_divide(
                  ret, rcount, out=ret, casting="unsafe", subok=False
              )
      elif hasattr(ret, "dtype"):
          ret = ret.dtype.type(ret / rcount)
      else:
          ret = ret / rcount
  
      return ret
  
imports: import warnings
  from contextlib import nullcontext
  from numpy.core import multiarray
  from numpy.core import umath
  from numpy.core.multiarray import asanyarray
  from numpy.core import numerictypes
  from numpy.core import _exceptions
  from numpy.core._ufunc_config import _no_nep50_warning
  from numpy._globals import _NoValue
  from numpy.compat import pickle, os_fspath
label_desc: Use image node_id 10 for calling a global function with example usage: _var(a, axis, dtype, out, ddof, keepdims) and returns: ret