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

Function removeHeader

numpy/linalg/lapack_lite/clapack_scrub.py:207–234  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

205 return lines.getValue()
206
207def removeHeader(source):
208 lines = LineQueue()
209
210 def LookingForHeader(line):
211 m = re.match(r'/\*[^\n]*-- translated', line)
212 if m:
213 return InHeader
214 else:
215 lines.add(line)
216 return LookingForHeader
217
218 def InHeader(line):
219 if line.startswith('*/'):
220 return OutOfHeader
221 else:
222 return InHeader
223
224 def OutOfHeader(line):
225 if line.startswith('#include "f2c.h"'):
226 pass
227 else:
228 lines.add(line)
229 return OutOfHeader
230
231 state = LookingForHeader
232 for line in UStringIO(source):
233 state = state(line)
234 return lines.getValue()
235
236def removeSubroutinePrototypes(source):
237 # This function has never worked as advertised by its name:

Callers

nothing calls this directly

Calls 2

getValueMethod · 0.95
LineQueueClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…