code: def outer(self, A, B, **kwargs):
      if self.nin != 2:
          raise ValueError(
              "outer product only supported for binary functions"
          )
      if "out" in kwargs:
          raise ValueError("`out` kwarg not supported")
  
      A_is_dask = is_dask_collection(A)
      B_is_dask = is_dask_collection(B)
      if not A_is_dask and not B_is_dask:
          return self._ufunc.outer(A, B, **kwargs)
      elif (
          A_is_dask
          and not isinstance(A, Array)
          or B_is_dask
          and not isinstance(B, Array)
      ):
          raise NotImplementedError(
              "Dask objects besides `dask.array.Array` "
              "are not supported at this time."
          )
  
      A = asarray(A)
      B = asarray(B)
      ndim = A.ndim + B.ndim
      out_inds = tuple(range(ndim))
      A_inds = out_inds[: A.ndim]
      B_inds = out_inds[A.ndim :]
  
      dtype = apply_infer_dtype(
          self._ufunc.outer,
          [A, B],
          kwargs,
          "ufunc.outer",
          suggest_dtype=False,
      )
  
      if "dtype" in kwargs:
          func = partial(self._ufunc.outer, dtype=kwargs.pop("dtype"))
      else:
          func = self._ufunc.outer
  
      return blockwise(
          func,
          out_inds,
          A,
          A_inds,
          B,
          B_inds,
          dtype=dtype,
          token=self.__name__ + ".outer",
          **kwargs,
      )
  
imports: from __future__ import annotations
  from functools import partial
  from operator import getitem
  import numpy
  from dask import core
  from dask.array.core import Array, apply_infer_dtype, asarray, blockwise, elemwise
  from dask.base import is_dask_collection, normalize_function
  from dask.highlevelgraph import HighLevelGraph
  from dask.utils import derived_from, funcname
label_desc: Use image node_id 6 for calling the ufunc obj's underlying member method code with example usage: obj.outer(A, B) and returns: blockwise, self