code: def imag(val, **kwargs):
      """
      Return the imaginary part of the complex argument.
  
      Parameters
      ----------
      val : array_like
          Input tensor.
  
      Returns
      -------
      out : Tensor or scalar
          The imaginary component of the complex argument. If `val` is real,
          the type of `val` is used for the output.  If `val` has complex
          elements, the returned type is float.
  
      See Also
      --------
      real, angle, real_if_close
  
      Examples
      --------
      >>> import mars.tensor as mt
  
      >>> a = mt.array([1+2j, 3+4j, 5+6j])
      >>> a.imag.execute()
      array([ 2.,  4.,  6.])
      >>> a.imag = mt.array([8, 10, 12])
      >>> a.execute()
      array([ 1. +8.j,  3.+10.j,  5.+12.j])
      >>> mt.imag(1 + 1j).execute()
      1.0
  
      """
      op = TensorImag(**kwargs)
      return op(val)
  
file_path: mars/mars/tensor/arithmetic/imag.py
imports: import numpy
  from ...None import opcodes
  from ..utils import infer_dtype
  from .core import TensorUnaryOp
  from .utils import arithmetic_operand
label_desc: Use image node_id 1 for calling a global function with example usage: imag(val) and returns: op