code: def _run_pre_execution_command_script(script_path: str):
      """This method runs a given shell script using subprocess
  
      Raises RuntimeEnvironmentError if the shell script fails
      """
      current_dir = os.path.dirname(script_path)
  
      process = subprocess.Popen(
          ["/bin/bash", "-eu", script_path],
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          cwd=current_dir,
      )
  
      _log_output(process)
      error_logs = _log_error(process)
      return_code = process.wait()
  
      return return_code, error_logs
  
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 3 for calling a global function with example usage: _run_pre_execution_command_script(script_path) and returns: return_code,  error_logs