code: def get_content_type(self):
          
          ctype = self.part.get_content_type()
          # replace underspecified mime description by a better guess
          if ctype in ['octet/stream', 'application/octet-stream',
                       'application/octetstream']:
              ctype = guess_mimetype(self.get_data())
          return ctype
docs: mime type of the attachment part