MCPcopy Index your code
hub / github.com/SpecterOps/DeepPass2 / check_document

Method check_document

utils/nprules.py:33–41  ·  view source on GitHub ↗

Check document against regex rules asynchronously.

(self, document)

Source from the content-addressed store, hash-verified

31 return patterns
32
33 async def check_document(self, document):
34 """Check document against regex rules asynchronously."""
35 loop = asyncio.get_running_loop()
36 tasks = [
37 loop.run_in_executor(self.executor, self.match_pattern, rule, document)
38 for rule in self.patterns
39 ]
40 results = await asyncio.gather(*tasks)
41 return [match for match in results if match]
42
43 def match_pattern(self, rule, document):
44 """Match a single regex pattern synchronously (runs in a thread pool)."""

Callers 2

get_nosey_parker_resultsFunction · 0.95
nprules.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected