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

Method new_module

tests/test_zzz_autoreload.py:152–157  ·  view source on GitHub ↗
(self, code)

Source from the content-addressed store, hash-verified

150 f.write(content)
151
152 def new_module(self, code):
153 code = textwrap.dedent(code)
154 mod_name, mod_fn = self.get_module()
155 with open(mod_fn, "w", encoding="utf-8") as f:
156 f.write(code)
157 return mod_name, mod_fn
158
159
160# -----------------------------------------------------------------------------

Calls 2

get_moduleMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected