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

Function getmultilineblock

numpy/f2py/auxfuncs.py:643–670  ·  view source on GitHub ↗
(rout, blockname, comment=1, counter=0)

Source from the content-addressed store, hash-verified

641
642
643def getmultilineblock(rout, blockname, comment=1, counter=0):
644 try:
645 r = rout['f2pyenhancements'].get(blockname)
646 except KeyError:
647 return
648 if not r:
649 return
650 if counter > 0 and isinstance(r, str):
651 return
652 if isinstance(r, list):
653 if counter >= len(r):
654 return
655 r = r[counter]
656 if r[:3] == "'''":
657 if comment:
658 r = '\t/* start ' + blockname + \
659 ' multiline (' + repr(counter) + ') */\n' + r[3:]
660 else:
661 r = r[3:]
662 if r[-3:] == "'''":
663 if comment:
664 r = r[:-3] + '\n\t/* end multiline (' + repr(counter) + ')*/'
665 else:
666 r = r[:-3]
667 else:
668 errmess("%s multiline block should end with `'''`: %s\n"
669 % (blockname, repr(r)))
670 return r
671
672
673def getcallstatement(rout):

Callers 5

getcallstatementFunction · 0.85
getcallprotoargumentFunction · 0.85
getusercodeFunction · 0.85
getusercode1Function · 0.85
getpymethoddefFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected