def run_cell_magic(self, magic_name, line, cell):
    "Execute the given cell magic.\n\n        Parameters\n        ----------\n        magic_name : str\n            Name of the desired magic function, without '%' prefix.\n        line : str\n            The rest of the first input line as a single string.\n        cell : str\n            The body of the cell as a (possibly multiline) string.\n        "
    fn = self._find_with_lazy_load('cell', magic_name)
    if (fn is None):
        lm = self.find_line_magic(magic_name)
        etpl = 'Cell magic `%%{0}` not found{1}.'
        extra = ('' if (lm is None) else ' (But line magic `%{0}` exists, did you mean that instead?)'.format(magic_name))
        raise UsageError(etpl.format(magic_name, extra))
    elif (cell == ''):
        message = '%%{0} is a cell magic, but the cell body is empty.'.format(magic_name)
        if (self.find_line_magic(magic_name) is not None):
            message += ' Did you mean the line magic %{0} (single %)?'.format(magic_name)
        raise UsageError(message)
    else:
        stack_depth = 2
        if getattr(fn, magic.MAGIC_NO_VAR_EXPAND_ATTR, False):
            magic_arg_s = line
        else:
            magic_arg_s = self.var_expand(line, stack_depth)
        kwargs = {}
        if getattr(fn, 'needs_local_scope', False):
            kwargs['local_ns'] = self.user_ns
        with self.builtin_trap:
            args = (magic_arg_s, cell)
            result = fn(*args, **kwargs)
        return result
Execute the given cell magic.

Parameters
----------
magic_name : str
    Name of the desired magic function, without '%' prefix.
line : str
    The rest of the first input line as a single string.
cell : str
    The body of the cell as a (possibly multiline) string.
def run_cell_magic(self, magic_name, line, cell):
    "Execute the given cell magic.\n\n        Parameters\n        ----------\n        magic_name : str\n            Name of the desired magic function, without '%' prefix.\n        line : str\n            The rest of the first input line as a single string.\n        cell : str\n            The body of the cell as a (possibly multiline) string.\n        "
    fn = self._find_with_lazy_load('cell', magic_name)
    if (fn is None):
        lm = self.find_line_magic(magic_name)
        etpl = 'Cell magic `%%{0}` not found{1}.'
        extra = ( if (lm is None) else ' (But line magic `%{0}` exists, did you mean that instead?)'.format(magic_name))
        raise UsageError(etpl.format(magic_name, extra))
    elif (cell == ):
        message = '%%{0} is a cell magic, but the cell body is empty.'.format(magic_name)
        if (self.find_line_magic(magic_name) is not None):
            message += ' Did you mean the line magic %{0} (single %)?'.format(magic_name)
        raise UsageError(message)
    else:
        stack_depth = 2
        if getattr(fn, magic.MAGIC_NO_VAR_EXPAND_ATTR, False):
            magic_arg_s = line
        else:
            magic_arg_s = self.var_expand(line, stack_depth)
        kwargs = {}
        if getattr(fn, 'needs_local_scope', False):
            kwargs['local_ns'] = self.user_ns
        with self.builtin_trap:
            args = (magic_arg_s, cell)
            result = fn(*args, **kwargs)
        return result