Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
1"""Python code text splitter."""2 3from __future__ import annotations4 5from typing import Any6 7from langchain_text_splitters.base import Language8from langchain_text_splitters.character import RecursiveCharacterTextSplitter9 10 11class PythonCodeTextSplitter(RecursiveCharacterTextSplitter):12    """Attempts to split the text along Python syntax."""13 14    def __init__(self, **kwargs: Any) -> None:15        """Initialize a `PythonCodeTextSplitter`."""16        separators = self.get_separators_for_language(Language.PYTHON)17        super().__init__(separators=separators, **kwargs)18 
codekingpro/portable-devtools · Team Ai