MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _thread_mapper

Function _thread_mapper

pre_commit/xargs.py:121–128  ·  view source on GitHub ↗
(maxsize: int)

Source from the content-addressed store, hash-verified

119
120@contextlib.contextmanager
121def _thread_mapper(maxsize: int) -> Generator[
122 Callable[[Callable[[TArg], TRet], Iterable[TArg]], Iterable[TRet]],
123]:
124 if maxsize == 1:
125 yield map
126 else:
127 with concurrent.futures.ThreadPoolExecutor(maxsize) as ex:
128 yield ex.map
129
130
131def xargs(

Callers 1

xargsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected