def get_im_version():
    """Return Image Magick version or None if it is unavailable
    Try invoking ImageMagick's "convert"."""
    try:
        out = util.command_output([b'identify', b'--version'])

        if 'imagemagick' != out.lower():
            pattern = r".+ (\d+)\.(\d+)\.(\d+).*"
            match = re.search(pattern, out)
            if match:
                return (int(match.group(1)),
                        int(match.group(2)),
                        int(match.group(3)))
            return (0,)

    except (subprocess.CalledProcessError, OSError):
        return None
dataset/ETHPy150Open beetbox/beets/beets/util/artresizer.py/get_im_version/operator `in` -> `!=`