MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / keep

Function keep

graphify/extract.py:4775–4782  ·  view source on GitHub ↗
(branch: int, bodies: list[tuple[int, int]], kept: list[int])

Source from the content-addressed store, hash-verified

4773 out[start:end] = source[start:end].translate(_CSHARP_BLANK_TABLE)
4774
4775 def keep(branch: int, bodies: list[tuple[int, int]], kept: list[int]) -> bool:
4776 if branch == 0:
4777 return True
4778 start, end = bodies[branch]
4779 if not _csharp_branch_balanced(out, start, end):
4780 return False
4781 sigs = _csharp_branch_member_sigs(out, start, end)
4782 return not any(sigs & _csharp_branch_member_sigs(out, *bodies[k]) for k in kept)
4783
4784 # Each open #if group: the (directive start, directive end) of its #if and
4785 # of every #elif/#else seen so far.

Callers 2

closeFunction · 0.70
in_stub_crateFunction · 0.70

Calls 4

_csharp_branch_balancedFunction · 0.85
crate_ofFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected