MCPcopy Create free account
hub / github.com/ipython/ipython / assign_from_system

Function assign_from_system

IPython/core/inputtransformer.py:516–522  ·  view source on GitHub ↗

Transform assignment from system commands (e.g. files = !ls)

(line)

Source from the content-addressed store, hash-verified

514assign_system_template = '%s = get_ipython().getoutput(%r)'
515@StatelessInputTransformer.wrap
516def assign_from_system(line):
517 """Transform assignment from system commands (e.g. files = !ls)"""
518 m = assign_system_re.match(line)
519 if m is None:
520 return line
521
522 return assign_system_template % m.group('lhs', 'cmd')
523
524assign_magic_re = re.compile(r'{}%\s*(?P<cmd>.*)'.format(_assign_pat), re.VERBOSE)
525assign_magic_template = '%s = get_ipython().run_line_magic(%r, %r)'

Callers 1

__init__Method · 0.90

Calls 1

groupMethod · 0.80

Tested by

no test coverage detected