code: def _get_command_stdout(command, *args):
      import io, os, shutil, subprocess
  
      try:
          path_dirs = os.environ.get("PATH", os.defpath).split(
              os.pathsep
          )
          path_dirs.extend(["/sbin", "/usr/sbin"])
          executable = shutil.which(
              command, path=os.pathsep.join(path_dirs)
          )
          if executable is None:
              return None
          # LC_ALL=C to ensure English output, stderr=DEVNULL to prevent output
          # on stderr (Note: we don't have an example where the words we search
          # for are actually localized, but in theory some system could do so.)
          env = dict(os.environ)
          env["LC_ALL"] = "C"
          # Empty strings will be quoted by popen so we should just ommit it
          if args != ("",):
              command = (executable, *args)
          else:
              command = (executable,)
          proc = subprocess.Popen(
              command,
              stdout=subprocess.PIPE,
              stderr=subprocess.DEVNULL,
              env=env,
          )
          if not proc:
              return None
          stdout, stderr = proc.communicate()
          return io.BytesIO(stdout)
      except (OSError, subprocess.SubprocessError):
          return None
  
imports: import os
  import sys
  from enum import Enum, _simple_enum
label_desc: Use image node_id 1 for calling a global function with example usage: _get_command_stdout(command) and returns: io, None, None, None