code: def real(val, **kwargs):
      """
      Return the real part of the complex argument.
  
      Parameters
      ----------
      val : array_like
          Input tensor.
  
      Returns
      -------
      out : Tensor or scalar
          The real 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_if_close, imag, angle
  
      Examples
      --------
      >>> import mars.tensor as mt
  
      >>> a = mt.array([1+2j, 3+4j, 5+6j])
      >>> a.real.execute()
      array([ 1.,  3.,  5.])
      >>> a.real = 9
      >>> a.execute()
      array([ 9.+2.j,  9.+4.j,  9.+6.j])
      >>> a.real = mt.array([9, 8, 7])
      >>> a.execute()
      array([ 9.+2.j,  8.+4.j,  7.+6.j])
      >>> mt.real(1 + 1j).execute()
      1.0
  
      """
      op = TensorReal(**kwargs)
      return op(val)
  
file_path: mars/mars/tensor/arithmetic/real.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: real(val) and returns: op