code: def wrap_commands_in_shell(ostype, commands):
      
      if ostype.lower() == 'linux':
          return '/bin/bash -c \'set -e; set -o pipefail; {}; wait\''.format(
              ';'.join(commands))
      elif ostype.lower() == 'windows':
          return 'cmd.exe /c "{}"'.format('&'.join(commands))
      else:
          raise ValueError('unknown ostype: {}'.format(ostype))
docs: Wrap commands in a shell
      Originally in azure-batch-samples.Python.Batch.common.helpers
  
      :param list commands: list of commands to wrap
      :param str ostype: OS type, linux or windows
      :rtype: str
      :return: a shell wrapping commands