MCPcopy Index your code
hub / github.com/numpy/numpy / autostrip

Method autostrip

numpy/lib/_iotools.py:149–167  ·  view source on GitHub ↗

Wrapper to strip each member of the output of `method`. Parameters ---------- method : function Function that takes a single argument and returns a sequence of strings. Returns ------- wrapped : function T

(self, method)

Source from the content-addressed store, hash-verified

147 """
148
149 def autostrip(self, method):
150 """
151 Wrapper to strip each member of the output of `method`.
152
153 Parameters
154 ----------
155 method : function
156 Function that takes a single argument and returns a sequence of
157 strings.
158
159 Returns
160 -------
161 wrapped : function
162 The result of wrapping `method`. `wrapped` takes a single input
163 argument and returns a list of strings that are stripped of
164 white-space.
165
166 """
167 return lambda input: [_.strip() for _ in method(input)]
168
169 def __init__(self, delimiter=None, comments='#', autostrip=True,
170 encoding=None):

Callers 1

__init__Method · 0.95

Calls 2

stripMethod · 0.80
methodFunction · 0.50

Tested by

no test coverage detected