code: def sh_e(cls, cmd, **kwargs):
          
          Log.debug('CMD: {0}'.format(cmd))
          cmd_kwargs = {
              'shell': True,
          }
          cmd_kwargs.update(kwargs)
  
          env = os.environ.copy()
          # Better to parse English output
          env['LC_ALL'] = 'en_US.utf-8'
          if 'env' in kwargs:
              env.update(kwargs['env'])
          cmd_kwargs['env'] = env
          # Capture stderr to show it on error message.
          cmd_kwargs['stderr'] = subprocess.PIPE
  
          proc = None
          try:
              proc = subprocess.Popen(cmd, **cmd_kwargs)
              stdout, stderr = proc.communicate()
              returncode = proc.returncode
              message_format = (
                  'CMD Return Code: [{0}], Stdout: [{1}], Stderr: [{2}]'
              )
              Log.debug(message_format.format(returncode, stdout, stderr))
  
              if stdout is not None:
                  stdout = stdout.decode('utf-8')
              if stderr is not None:
                  stderr = stderr.decode('utf-8')
  
              if returncode != 0:
                  message = 'CMD: [{0}], Return Code: [{1}] at [{2}]'.format(
                      cmd, returncode, os.getcwd())
                  if stderr is not None:
                      message += ' Stderr: [{0}]'.format(stderr)
                  ie = CmdError(message)
                  ie.stdout = stdout
                  ie.stderr = stderr
                  raise ie
  
              return (stdout, stderr)
          except Exception as e:
              try:
                  proc.kill()
              except Exception:
                  pass
              raise e
docs: Run the command. It behaves like "sh -e".
  
          It raises InstallError if the command failed.