code: def run_shell(cmd):
      """This function can be used to run a command in the bash shell.
  
      Arguments
      ---------
      cmd : str
          Shell command to run.
  
      Returns
      -------
      bytes
          The captured standard output.
      bytes
          The captured standard error.
      int
          The returncode.
  
      Raises
      ------
      OSError
          If returncode is not 0, i.e., command failed.
  
      Example
      -------
      >>> out, err, code = run_shell("echo 'hello world'")
      >>> _ = out.decode(errors="ignore")
      """
  
      # Executing the command
      p = subprocess.Popen(
          cmd,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          shell=True,
      )
  
      # Capturing standard output and error
      (output, err) = p.communicate()
  
      if p.returncode != 0:
          raise OSError(err.decode(errors="replace"))
  
      # Adding information in the logger
      msg = (
          output.decode(errors="replace")
          + "\n"
          + err.decode(errors="replace")
      )
      logger.debug(msg)
  
      return output, err, p.returncode
  
imports: import logging
  import subprocess
  import importlib
  import pathlib
label_desc: Use image node_id 2 for calling a global function with example usage: run_shell(cmd) and returns: output,  err,  p