how to convert from infix to postfix/prefix using ast python module?,"['x', 'cos']"