Task: Text to Code
Input (English): select the row whose avg attend record of all rows is 2nd maximum . the indoor year record of this row is 1978 .
Output (English): eq { hop { nth_argmax { all_rows ; avg attend ; 2 } ; indoor year } ; 1978 }