Lines Matching full:magic
22 is "%" in which case it is a "magic" line.
24 The supported cell magic is:
26 * %reset - to reset the cached code and magic state.
27 * %noreset - to not reset the cached code and magic state
31 These are "cell magic" meaning it applies to the whole cell. Therefore
32 it must be the first line, or part of a run of magic lines starting
35 The following are global magic (that applies to all cells going
40 Global magic must be written in the same way as cell magic.
70 # A list of (code, magic) tuples.
74 # The most recent set of magic since the last reset.
158 """Given a block of code remove the magic lines from it.
159 Returns a tuple of newline joined code lines and a dictionary of magic.
160 Where the key is the magic name (minus the %) and the values are lists
161 of the arguments to the magic.
163 Currently we only look for "cell magic" which must be at the start of
165 that come before the first non-magic line.
186 magic = {}
196 magic[magic_parts[0][1:]] = magic_parts[1:]
201 return "\n".join(code_lines), magic
203 def should_reset(self, magic):
205 setting and the current cell's magic %reset and/or %noreset.
232 # Magic reset commands always win if present.
233 reset = magic.get("reset") is not None
234 noreset = magic.get("noreset") is not None