code: def convert_complex_output(out_in):
      
      out = {}
      for key, val in out_in.iteritems():
  
          if val.data.dtype in  complex_types:
              rval = copy(val)
              rval.data = val.data.real
              out['real(%s)' % key] = rval
  
              ival = copy(val)
              ival.data = val.data.imag
              out['imag(%s)' % key] = ival
  
          else:
              out[key] = val
  
      return out
docs: Convert complex values in the output dictionary `out_in` to pairs of
      real and imaginary parts.