code: def GetDictToFormat(self):
      
      d = {}
      for k, v in self.__dict__.items():
        # TODO: Better handling of unicode/utf-8 within Schedule objects.
        # Concatinating a unicode and utf-8 str object causes an exception such
        # as "UnicodeDecodeError: 'ascii' codec can't decode byte ..." as python
        # tries to convert the str to a unicode. To avoid that happening within
        # the problem reporter convert all unicode attributes to utf-8.
        # Currently valid utf-8 fields are converted to unicode in _ReadCsvDict.
        # Perhaps all fields should be left as utf-8.
        d[k] = util.EncodeUnicode(v)
      return d
docs: Return a copy of self as a dict, suitable for passing to FormatProblem