Ah I see, the original comment was meant to be parsed similar to the if statement itself:

if os.path.exists("%s/spark/bin/stop-all.sh" % proj_dir):
= if [a cluster could be running]