call the params.get method with string 'TIMEOUT' and integer 300 as arguments, use the string 'timeout' and previous result as the arguments for the call to the params.get method, substitute the result for timeout.
timeout = params . get ( 'timeout' , params . get ( 'TIMEOUT' , 300 ) )