code: def _is_ctype(self, ctype):
          
          if not self.valid:
              return False
          mime = self.content_type
          return self.ContentMimetypes.get(mime) == ctype
docs: Return True iff content is valid and of the given type.