def strip_commands(commands):
<EOL>stripped_commands = []<EOL>for v in commands:<EOL><INDENT>if isinstance(v, bytes):<EOL><INDENT>v = v.decode(errors='<STR_LIT:replace>')<EOL><DEDENT>v = v.split('<STR_LIT:;>')[<NUM_LIT:0>].strip()<EOL>if len(v) != <NUM_LIT:0>:<EOL><INDENT>stripped_commands.append(v)<EOL><DEDENT><DEDENT>return stripped_commands<EOL>
Strips a sequence of commands.

    Strips down the sequence of commands by removing comments and
    surrounding whitespace around each individual command and then
    removing blank commands.

    Parameters
    ----------
    commands : iterable of strings
        Iterable of commands to strip.

    Returns
    -------
    stripped_commands : list of str
        The stripped commands with blank ones removed.