MCPcopy Create free account
hub / github.com/numpy/numpy / findcommonblocks

Function findcommonblocks

numpy/f2py/common_rules.py:22–39  ·  view source on GitHub ↗
(block, top=1)

Source from the content-addressed store, hash-verified

20
21
22def findcommonblocks(block, top=1):
23 ret = []
24 if hascommon(block):
25 for key, value in block['common'].items():
26 vars_ = {v: block['vars'][v] for v in value}
27 ret.append((key, value, vars_))
28 elif hasbody(block):
29 for b in block['body']:
30 ret = ret + findcommonblocks(b, 0)
31 if top:
32 tret = []
33 names = []
34 for t in ret:
35 if t[0] not in names:
36 names.append(t[0])
37 tret.append(t)
38 return tret
39 return ret
40
41
42def buildhooks(m):

Callers 1

buildhooksFunction · 0.85

Calls 2

hascommonFunction · 0.85
hasbodyFunction · 0.85

Tested by

no test coverage detected