def _IsDiskImageReadOnly(self, filename):
    """Returns True if the disk image will mount read-only.

    Args:
      filename: str, disk image filename
    Returns:
      True, if the disk image will mount read-only.
      False, if the disk image will mount read-write.
    Raises:
      client.SimianClientError: the package is malformed.
    """
    try:
      argv = ['/usr/bin/hdiutil', 'imageinfo', filename]
      p = subprocess.Popen(
          argv,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE)
      (stdout, stderr) = p.communicate()
      rc = p.wait()
    except OSError, e:
      raise client.SimianClientError(
          'Could not hdiutil imageinfo %s: %s' % (filename, str(e)))

    if rc != 0:
      raise client.SimianClientError(
          (filename, str(rc), stderr) % '%s: %s: %s')

    if stdout:
      if re.search('Format Description:.*read\-only', stdout):
        return True

    return False
dataset/ETHPy150Open google/simian/src/simian/mac/client/client.py/SimianClient._IsDiskImageReadOnly/swapped operands of `%`