def package_exists(package):
    try:
        devnull = open('/dev/null', 'w')
        contents = subprocess.check_output("dpkg -s %s" % package, 
                stderr=devnull, shell=True)
        devnull.close()
    except subprocess.CalledProcessError, e:
        return False
    if "install ok installed" == contents:
        return True
    print("**PROBABLY ERROR OCCURED** while calling: %s" % "dpkg -s "+package)
    return False
dataset/ETHPy150Open cztomczak/cefpython/cefpython/cef3/linux/installer/find-deps.py/package_exists/operator `in` -> `==`