Have used python selenium script to trigger selenium server to run JavaScript code. It works fine.
drv.execute_script(\'\')
Thanks to the answer by @Richard who led me in the right direction and Brian's link (even thought it's for java) who helped me to figure out the meaning of "arguments".
The following code will do what I need.
ele = get_element_by_xpath('//button[@id="xyzw"]');
drv.execute_script('arguments[0].setAttribute("style", "color: yellow; border: 2px solid yellow;")', ele)