code: def imag(self):
          
          if self.space.is_real:
              return self.space.zero()
          elif self.space.is_complex:
              real_space = self.space.astype(self.space.real_dtype)
              return real_space.element(self.data.imag)
          else:
              raise NotImplementedError('`imag` not defined for non-numeric '
                                        'dtype {}'.format(self.dtype))
docs: Imaginary part of ``self``.
  
          Returns
          -------
          imag : `NumpyTensor`
              Imaginary part this element as an element of a
              `NumpyTensorSpace` with real data type.
  
          Examples
          --------
          Get the imaginary part:
  
          >>> space = odl.cn(3)
          >>> x = space.element([1 + 1j, 2, 3 - 3j])
          >>> x.imag
          rn(3).element([ 1.,  0., -3.])
  
          Set the imaginary part:
  
          >>> space = odl.cn(3)
          >>> x = space.element([1 + 1j, 2, 3 - 3j])
          >>> zero = odl.rn(3).zero()
          >>> x.imag = zero
          >>> x
          cn(3).element([ 1.+0.j,  2.+0.j,  3.+0.j])
  
          Other array-like types and broadcasting:
  
          >>> x.imag = 1.0
          >>> x
          cn(3).element([ 1.+1.j,  2.+1.j,  3.+1.j])
          >>> x.imag = [2, 3, 4]
          >>> x
          cn(3).element([ 1.+2.j,  2.+3.j,  3.+4.j])