You don't need a for loop here - you can just `return '_FLAG' in os.listdir(loc)`.