code: def process(command, fail_fast=True, timeout=120):
      import subprocess
  
      pro = subprocess.Popen(
          command,
          shell=True,
          cwd=None,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          preexec_fn=os.setsid,
      )
      out, err = pro.communicate(timeout=timeout)
      out = out.decode("utf-8")
      err = err.decode("utf-8")
      print(out)
      print(err)
      errorcode = pro.returncode
      if errorcode != 0:
          from bigdl.dllib.utils.log4Error import invalidInputError
  
          if fail_fast:
              invalidInputError(False, err)
          print(err)
      else:
          print(out)
      return out, err
  
imports: import os
label_desc: Use image node_id 1 for calling a global function with example usage: process(command, fail_fast, timeout) and returns: out,  err