| 92 | ipython_prompt = PromptStripper(re.compile(r'^(In \[\d+\]: |\s*\.{3,}: ?)')) |
| 93 | |
| 94 | def cell_magic(lines): |
| 95 | if not lines or not lines[0].startswith('%%'): |
| 96 | return lines |
| 97 | if re.match(r'%%\w+\?', lines[0]): |
| 98 | # This case will be handled by help_end |
| 99 | return lines |
| 100 | magic_name, _, first_line = lines[0][2:].rstrip().partition(' ') |
| 101 | body = ''.join(lines[1:]) |
| 102 | return ['get_ipython().run_cell_magic(%r, %r, %r)\n' |
| 103 | % (magic_name, first_line, body)] |
| 104 | |
| 105 | |
| 106 | def _find_assign_op(token_line) -> Union[int, None]: |