parameters: (self)
docstring: Swap the last two characters before the cursor.
docstring_summary: Swap the last two characters before the cursor.
docstring_tokens: Swap the last two characters before the cursor .
function: def swap_characters_before_cursor(self):
          """
          Swap the last two characters before the cursor.
          """
          pos = self.cursor_position
  
          if pos >= 2:
              a = self.text[pos - 2]
              b = self.text[pos - 1]
  
              self.text = self.text[:pos-2] + b + a + self.text[pos:]
function_tokens: def swap_characters_before_cursor ( self ) : pos = self . cursor_position if pos >= 2 : a = self . text [ pos - 2 ] b = self . text [ pos - 1 ] self . text = self . text [ : pos - 2 ] + b + a + self . text [ pos : ]