

@classmethod
def _shell_command_list_to_single_command(cls, commands):
    '\n        Combines a list of commands into a single command string\n\n        :param commands: a list of commands, optionally ending with semicolons\n        :type commands: list[str|None]\n        :return: returns the concatenated shell command on success, or None if there was an error\n        :rtype: string|None\n        '
    if (not isinstance(commands, list)):
        return None
    sanitized_commands = []
    for command in commands:
        if (command is None):
            continue
        stripped_command = command.strip().rstrip(';')
        postfix = (' ' if stripped_command.strip().endswith('&') else ' && ')
        sanitized_commands.append((stripped_command + postfix))
    joined_commands = ''.join(sanitized_commands).strip()
    if joined_commands.endswith('&&'):
        joined_commands = joined_commands.rstrip('&').strip()
    return cls

dataset/ETHPy150Open box/ClusterRunner/app/master/job_config.py JobConfig._shell_command_list_to_single_command/VarMisuse@140/297 `joined_commands`->`cls`