def get_mode(self):
        """Return current mode name as string."""
        ### return string according to handle_input method
        ### used

        if self.handle_input == self.normal_mode_handling:
            return "normal"

        elif self.handle_input == self.insert_mode_handling:
            return "insert"

        ### if no known event handling method is being used,
        ### which should not be possible, we assume
        ### something went wrong somewhere

        else:

            raise RuntimeError(
                (
                    "Entered 'else' block never supposed to"
                    " be entered; logic went wrong somewhere"
                )
            )
Return current mode name as string.
nodezator/textman/editor/cursor/op.py