def mixing_phases(U):
f = {}<EOL>f['<STR_LIT>'] = asin(abs(U[<NUM_LIT:0>,<NUM_LIT:2>]))<EOL>if U[<NUM_LIT:0>,<NUM_LIT:0>] == <NUM_LIT:0>:<EOL><INDENT>f['<STR_LIT>'] = pi/<NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>f['<STR_LIT>'] = atan(abs(U[<NUM_LIT:0>,<NUM_LIT:1>])/abs(U[<NUM_LIT:0>,<NUM_LIT:0>]))<EOL><DEDENT>if U[<NUM_LIT:2>,<NUM_LIT:2>] == <NUM_LIT:0>:<EOL><INDENT>f['<STR_LIT>'] = pi/<NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>f['<STR_LIT>'] = atan(abs(U[<NUM_LIT:1>,<NUM_LIT:2>])/abs(U[<NUM_LIT:2>,<NUM_LIT:2>]))<EOL><DEDENT>s12 = sin(f['<STR_LIT>'])<EOL>c12 = cos(f['<STR_LIT>'])<EOL>s13 = sin(f['<STR_LIT>'])<EOL>c13 = cos(f['<STR_LIT>'])<EOL>s23 = sin(f['<STR_LIT>'])<EOL>c23 = cos(f['<STR_LIT>'])<EOL>if (s12*s23) == <NUM_LIT:0> or (c12*c13**<NUM_LIT:2>*c23*s13) == <NUM_LIT:0>:<EOL><INDENT>f['<STR_LIT>'] = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>f['<STR_LIT>'] = -phase((U[<NUM_LIT:0>,<NUM_LIT:0>].conj()*U[<NUM_LIT:0>,<NUM_LIT:2>]*U[<NUM_LIT:2>,<NUM_LIT:0>]*U[<NUM_LIT:2>,<NUM_LIT:2>].conj()/(c12*c13**<NUM_LIT:2>*c23*s13) + c12*c23*s13)/(s12*s23))<EOL><DEDENT>f['<STR_LIT>']  = phase(exp(<NUM_LIT>*f['<STR_LIT>']) * U[<NUM_LIT:0>, <NUM_LIT:2>])<EOL>f['<STR_LIT>']  = phase(U[<NUM_LIT:1>, <NUM_LIT:2>])<EOL>f['<STR_LIT>']  = phase(U[<NUM_LIT:2>, <NUM_LIT:2>])<EOL>f['<STR_LIT>'] = <NUM_LIT:2>*phase(exp(<NUM_LIT>*f['<STR_LIT>']) * U[<NUM_LIT:0>, <NUM_LIT:0>].conj())<EOL>f['<STR_LIT>'] = <NUM_LIT:2>*phase(exp(<NUM_LIT>*f['<STR_LIT>']) * U[<NUM_LIT:0>, <NUM_LIT:1>].conj())<EOL>return f<EOL>
Return the angles and CP phases of the CKM or PMNS matrix
    in standard parametrization, starting from a matrix with arbitrary phase
    convention.