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

Method __init__

IPython/core/macro.py:23–36  ·  view source on GitHub ↗

store the macro value, as a single string which can be executed

(self,code)

Source from the content-addressed store, hash-verified

21 """
22
23 def __init__(self,code):
24 """store the macro value, as a single string which can be executed"""
25 lines = []
26 enc = None
27 for line in code.splitlines():
28 coding_match = coding_declaration.match(line)
29 if coding_match:
30 enc = coding_match.group(1)
31 else:
32 lines.append(line)
33 code = "\n".join(lines)
34 if isinstance(code, bytes):
35 code = code.decode(enc or DEFAULT_ENCODING)
36 self.value = code + '\n'
37
38 def __str__(self):
39 return self.value

Callers

nothing calls this directly

Calls 2

matchMethod · 0.80
groupMethod · 0.80

Tested by

no test coverage detected