docs: def get_mimetype(path):
          """
          Guesses the mime type of a file. If mime type cannot be detected, plain
          text is assumed.
  
          :param path: path of the file
          :return: the corresponding mime type.
          """
          filename = os.path.split(path)[1]
          mimetype = mimetypes.guess_type(filename)[0]
          if mimetype is None:
              mimetype = 'text/x-plain'
          _logger().debug('mimetype detected: %s', mimetype)
          return mimetype