def find_matching_bracket_position(self, start_pos=None, end_pos=None):

        # Look for a match.
        for A, B in '()', '[]', '{}', '<>':
            if self.current_char == A:
                return self.find_enclosing_bracket_right(A, B, end_pos=end_pos) or 0
            elif self.current_char == B:
                return self.find_enclosing_bracket_left(A, B, start_pos=start_pos) or 0

        return 0
Return relative cursor position of matching [, (, { or < bracket.
dataset/ETHPy150Open jonathanslenders/python-prompt-toolkit/prompt_toolkit/document.py/Document.find_matching_bracket_position