'Write out the info dictionary, checking it for good form'

def writeInfoDict(self):

    def is_string_like(x):
        return isinstance(x, six.string_types)
    def is_date(x):
        return isinstance(x, datetime)
    check_trapped = (lambda x: (isinstance(x, Name) and (x.name in (u'True', u'False', u'Unknown'))))
    keywords = {u'Title': is_string_like, u'Author': is_string_like, u'Subject': is_string_like, u'Keywords': is_string_like, u'Creator': is_string_like, u'Producer': is_string_like, u'CreationDate': is_date, u'ModDate': is_date, u'Trapped': check_trapped}
    for k in self.infoDict:
        if (k not in keywords):
            warnings.warn((u'Unknown    infodict    keyword:    %s' % k))
        elif (not keywords[k](self.infoDict[k])):
            warnings.warn((u'Bad    value    for    infodict    keyword    %s' % k))
    self.infoObject = self.reserveObject(u'info')
    self.writeObject(self.infoObject, self.infoDict)
