code: def guess(filename, fallback='application/octet-stream'):
      
      guessed, encoding = mimetypes.guess_type(filename, strict=False)
      if guessed is None:
          return fallback, encoding
      return guessed, encoding
docs: Using the mimetypes library, guess the mimetype and
      encoding for a given *filename*. If the mimetype
      cannot be guessed, *fallback* is assumed instead.
  
      :param filename: Filename- can be absolute path.
      :param fallback: A fallback mimetype.