4.29 How to change \(\arctan (y,x)\) to \(\arctan \left (\frac {y}{x}\right )\) in an expression

I needed to do this as I was translating Maple code to Sagemath. Where sagemath supports \(\arctan \) with only one argument.

Given an expression such as

\[ x +\arctan \left (y,x \right )+\sin \left (x \right ) \]
Convert it to
\[ x +\arctan \left (\frac {y}{x}\right )+\sin \left (x \right ) \]
evalindets(expr,'specfunc(arctan)',f->`if`(nops(f)=2,arctan(op(1,f)/op(2,f)),f))