def run_shell_commands(commands, **kwargs):
    'Runs a list of Notebook-like shell commands.\n\n  Lines starting with `#` are ignored as comments.\n  Lines starting with `!` are run as commands.\n  Variables like `{variable}` are substituted with **kwargs.\n  '
    for cmd in commands:
        cmd = cmd.strip().lstrip('!').format(**kwargs)
        sp_cmd = shlex.split(cmd, comments=True, posix=True)
        if sp_cmd:
            sp.call(sp_cmd)
            (yield sp_cmd)
Runs a list of Notebook-like shell commands.

Lines starting with `#` are ignored as comments.
Lines starting with `!` are run as commands.
Variables like `{variable}` are substituted with **kwargs.
def run_shell_commands(commands, **kwargs):
    'Runs a list of Notebook-like shell commands.\n\n  Lines starting with `#` are ignored as comments.\n  Lines starting with `!` are run as commands.\n  Variables like `{variable}` are substituted with **kwargs.\n  '
    for cmd in commands:
        cmd = cmd.strip().lstrip('!').format(**kwargs)
        sp_cmd = shlex.split(cmd, comments=True, posix=True)
        if sp_cmd:
            sp.call(sp_cmd)
            (yield sp_cmd)