MCPcopy Create free account
hub / github.com/Doorman11991/smallcode / trim_chunk

Function trim_chunk

scripts/rag_scraper.py:125–128  ·  view source on GitHub ↗
(lines: List[str], max_lines: int)

Source from the content-addressed store, hash-verified

123
124
125def trim_chunk(lines: List[str], max_lines: int) -> List[str]:
126 if len(lines) <= max_lines:
127 return lines
128 return lines[:max_lines]
129
130
131def sliding_chunks(lines: List[str], chunk_lines: int, overlap: int) -> Iterator[Tuple[int, List[str]]]:

Callers 1

chunk_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected