code: def run(cmd, input=None, capture_output=False, check=False, quiet=False, **kwargs):
      
      if input is not None:
          kwargs['stdin'] = subprocess.PIPE
      if capture_output:
          kwargs['stdout'] = kwargs['stderr'] = subprocess.PIPE
  
      try:
          proc = subprocess.Popen(cmd, startupinfo=get_startupinfo(), **kwargs)
      except OSError as e:
          if e.errno == errno.ENOENT:
              raise ExecutableNotFound(cmd)
          else:
              raise
  
      out, err = proc.communicate(input)
  
      if not quiet and err:
          stderr_write_bytes(err, flush=True)
      if check and proc.returncode:
          raise CalledProcessError(proc.returncode, cmd, output=out, stderr=err)
  
      return out, err
docs: Run the command described by cmd and return its (stdout, stderr) tuple.