MCPcopy Index your code
hub / github.com/ipython/ipython / find

Method find

IPython/core/inputtransformer2.py:564–574  ·  view source on GitHub ↗

Find the first help command (foo?) in the cell.

(cls, tokens_by_line)

Source from the content-addressed store, hash-verified

562
563 @classmethod
564 def find(cls, tokens_by_line):
565 """Find the first help command (foo?) in the cell.
566 """
567 for line in tokens_by_line:
568 # Last token is NEWLINE; look at last but one
569 if len(line) > 2 and line[-2].string == '?':
570 # Find the first token that's not INDENT/DEDENT
571 ix = 0
572 while line[ix].type in {tokenize.INDENT, tokenize.DEDENT}:
573 ix += 1
574 return cls(line[ix].start, line[-2].start)
575
576 def transform(self, lines):
577 """Transform a help command found by the ``find()`` classmethod.

Callers 13

validateMethod · 0.45
__call__Method · 0.45
magic_config_matchesMethod · 0.45
parse_breakpointFunction · 0.45
load_nextFunction · 0.45
process_outputMethod · 0.45
testMethod · 0.45
collectMethod · 0.45
test_attrsFunction · 0.45
transformerMethod · 0.45
syntax_error_transformerFunction · 0.45

Calls

no outgoing calls

Tested by 6

testMethod · 0.36
collectMethod · 0.36
test_attrsFunction · 0.36
transformerMethod · 0.36
syntax_error_transformerFunction · 0.36
check_findFunction · 0.36