code: def pretty_print(self, warnings=False):
          
          msg = []
          if (warnings) and (len(self.warnings) > 0):
              msg.append(u"Warnings:")
              for warning in self.warnings:
                  msg.append(u"  %s" % warning)
          if len(self.errors) > 0:
              msg.append(u"Errors:")
              for error in self.errors:
                  msg.append(u"  %s" % error)
          return u"\n".join(msg)
docs: Pretty print warnings and errors.
  
          :param bool warnings: if ``True``, also print warnings.
          :rtype: string