code: def XYZ_to_IPT(cobj, *args, **kwargs):
      
      if cobj.illuminant != 'd65' or cobj.observer != '2':
          raise ValueError('XYZColor for XYZ->IPT conversion needs to be D65 adapted.')
      xyz_values = numpy.array(cobj.get_value_tuple())
      lms_values = numpy.dot(
          IPTColor.conversion_matrices['xyz_to_lms'],
          xyz_values)
  
      lms_prime = numpy.sign(lms_values) * numpy.abs(lms_values) ** 0.43
  
      ipt_values = numpy.dot(
          IPTColor.conversion_matrices['lms_to_ipt'],
          lms_prime)
      return IPTColor(*ipt_values)
docs: Converts XYZ to IPT.
  
      NOTE: XYZ values need to be adapted to 2 degree D65
  
      Reference:
      Fairchild, M. D. (2013). Color appearance models, 3rd Ed. (pp. 271-272). John Wiley & Sons.