Water Atomizer in Raspberry Pi using Grove Base HAT

Hi all, I want to write a simple program for turning the Grove water atomizer on using raspberry pi. Sadly, there is no python library for this particular device and I am struggling with translating the arduino commands to python. In short, how do I modulate the water atomizer on/off. Here is the arduino sample code attached