def pprofile(line, cell=None):
    """
    Profile line execution.
    """
    if cell is None:
        # TODO: detect and use arguments (statistical profiling, ...) ?
        return run(line)
    return _main(
        ['%%pprofile', '-m', '-'] + shlex.split(line),
        io.StringIO(cell),
    )
Profile line execution.