mv drain.py to agie_svr.py and set up funct to split up and down in agie_svr