def _comment_ipython_line_magic(line, magic):
    """Adds suffix to line magics: # [magic] %{name}

    Converts:
    %timeit x = 1

    Into:
    x = 1 # [magic] %timeit
    """
    return line.replace(magic, '').strip() + f' # [magic] {magic.strip()}'