def preprocess_text(self, text: str) -> str:
        """
        Returns the preprocessed text. This procedure is identical to what was used when training the tokenizer.
        """

        # Remove non-printing characters
        text = self.non_printing_characters_re.sub("", text)

        # Normalize whitespaces
        text = "".join([char if char not in self.whitespaces else " " for char in text])

        # NFC Unicode normalization
        text = unicodedata.normalize("NFC", text)
        return text

        Returns the preprocessed text. This procedure is identical to what was used when training the tokenizer.
        
dpkd/transformers/src/transformers/models/gpt_sw3/tokenization_gpt_sw3.py