Hi.
First I'd like to point that action
is an expression representing the variation of the action, written as an equation. Therefore, the zeroes component of the equation is the left-hand side, i.e., action[0]
is $\delta S$, while the first component of the equation is the right-hand side, i.e., action[1]
represents the whole integral , $\int \Big( \cdots \Big) \mathrm{d}x$.
Since the left-hand side of action
is composed by other terms, you can repeat the decomposition process... and this allow you to select the piece of the expression for you to manipulate. In the notebook you mention, action[1][0][0][2]
represents the term containing the variation of the metric (without the variation of the connection).