code: def chunk_einsum(*operands, **kwargs):
      subscripts = kwargs.pop("subscripts")
      ncontract_inds = kwargs.pop("ncontract_inds")
      dtype = kwargs.pop("kernel_dtype")
      einsum = einsum_lookup.dispatch(type(operands[0]))
      chunk = einsum(subscripts, *operands, dtype=dtype, **kwargs)
  
      # Avoid concatenate=True in blockwise by adding 1's
      # for the contracted dimensions
      return chunk.reshape(chunk.shape + (1,) * ncontract_inds)
  
imports: from __future__ import annotations
  import numpy
  from dask.array.core import asarray, blockwise, einsum_lookup
  from dask.utils import derived_from
label_desc: Use image node_id 1 for calling a global function with example usage: chunk_einsum() and returns: chunk