def get_valid_indentations(self, idx):
<EOL>stack_top = -<NUM_LIT:1><EOL>if (<EOL>self._tokens.token(idx) in ("<STR_LIT:}>", "<STR_LIT>")<EOL>and self._cont_stack[-<NUM_LIT:1>].token == "<STR_LIT::>"<EOL>):<EOL><INDENT>stack_top = -<NUM_LIT:2><EOL><DEDENT>indent = self._cont_stack[stack_top]<EOL>if self._tokens.token(idx) in _CLOSING_BRACKETS:<EOL><INDENT>valid_indentations = indent.valid_outdent_strings<EOL><DEDENT>else:<EOL><INDENT>valid_indentations = indent.valid_continuation_strings<EOL><DEDENT>return indent, valid_indentations.copy()<EOL>
Returns the valid offsets for the token at the given position.