MCPcopy Create free account
hub / github.com/ipython/ipython / find

Method find

IPython/core/inputtransformer2.py:192–202  ·  view source on GitHub ↗

Find one instance of special syntax in the provided tokens. Tokens are grouped into logical lines for convenience, so it is easy to e.g. look at the first token of each line. *tokens_by_line* is a list of lists of tokenize.TokenInfo objects. This should return an in

(cls, tokens_by_line)

Source from the content-addressed store, hash-verified

190
191 @classmethod
192 def find(cls, tokens_by_line):
193 """Find one instance of special syntax in the provided tokens.
194
195 Tokens are grouped into logical lines for convenience,
196 so it is easy to e.g. look at the first token of each line.
197 *tokens_by_line* is a list of lists of tokenize.TokenInfo objects.
198
199 This should return an instance of its class, pointing to the start
200 position it has found, or None if it found no match.
201 """
202 raise NotImplementedError
203
204 def transform(self, lines: List[str]):
205 """Transform one instance of special syntax found by ``find()``

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected