code: def _run_shell_cmd(cmd: str):
      """This method runs a given shell command using subprocess
  
      Raises RuntimeEnvironmentError if the command fails
      """
  
      process = subprocess.Popen(
          (cmd),
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          shell=True,
      )
  
      _log_output(process)
      error_logs = _log_error(process)
      return_code = process.wait()
      if return_code:
          error_message = f"Encountered error while running command '{cmd}'. Reason: {error_logs}"
          raise RuntimeEnvironmentError(error_message)
  
imports: from __future__ import absolute_import
  import logging
  import sys
  import shlex
  import os
  import subprocess
  import time
  import dataclasses
  import json
label_desc: Use image node_id 4 for calling a global function with example usage: _run_shell_cmd(cmd) without return types