code: def GetActiveComposition(self) -> TextRange:
          
          textRange = self.pattern.GetActiveComposition()
          if textRange:
              return TextRange(textRange=textRange)
docs: Call IUIAutomationTextEditPattern::GetActiveComposition.
          Return `TextRange` or None, the active composition.
          Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiautomationtexteditpattern-getactivecomposition