code: def represent_complex(self, data):
      if data.imag == 0.0:
          data = "%r" % data.real
      elif data.real == 0.0:
          data = "%rj" % data.imag
      elif data.imag > 0:
          data = "%r+%rj" % (data.real, data.imag)
      else:
          data = "%r%rj" % (data.real, data.imag)
      return self.represent_scalar(
          "tag:yaml.org,2002:python/complex", data
      )
  
imports: from .error import *
  from .nodes import *
  import datetime, copyreg, types, base64, collections
label_desc: Use image node_id 1 for calling the Representer obj's underlying member method code with example usage: obj.represent_complex(data) and returns: self