pylint/checkers/format.py
def get_valid_indentations(self, idx):
        """Returns the valid offsets for the token at the given position."""
        # The closing brace on a dict or the 'for' in a dict comprehension may
        # reset two indent levels because the dict value is ended implicitly
        stack_top = -1
        if (
            self._tokens.token(idx) in ("}", "for")
            and self._cont_stack[-1].token == ":"
        ):
            stack_top = -2
        indent = self._cont_stack[stack_top]
        if self._tokens.token(idx) in _CLOSING_BRACKETS:
            valid_indentations = indent.valid_outdent_strings
        else:
            valid_indentations = indent.valid_continuation_strings
        return indent, valid_indentations.copy()
def get_valid_indentations(self, idx):
        # The closing brace on a dict or the 'for' in a dict comprehension may
        # reset two indent levels because the dict value is ended implicitly
        stack_top = -1
        if (
            self._tokens.token(idx) in ("}", "for")
            and self._cont_stack[-1].token == ":"
        ):
            stack_top = -2
        indent = self._cont_stack[stack_top]
        if self._tokens.token(idx) in _CLOSING_BRACKETS:
            valid_indentations = indent.valid_outdent_strings
        else:
            valid_indentations = indent.valid_continuation_strings
        return indent, valid_indentations.copy()
def get_valid_indentations ( self , idx ) : # The closing brace on a dict or the 'for' in a dict comprehension may # reset two indent levels because the dict value is ended implicitly stack_top = - 1 if ( self . _tokens . token ( idx ) in ( "}" , "for" ) and self . _cont_stack [ - 1 ] . token == ":" ) : stack_top = - 2 indent = self . _cont_stack [ stack_top ] if self . _tokens . token ( idx ) in _CLOSING_BRACKETS : valid_indentations = indent . valid_outdent_strings else : valid_indentations = indent . valid_continuation_strings return indent , valid_indentations . copy ( )
Returns the valid offsets for the token at the given position.
Returns the valid offsets for the token at the given position .