code: def run_pipes(self, cmd, args=(), cwd=None):
      if cwd is None:
          cwd = self.working_path
      try:
          # Start subprocess
          cmd_str = self.cmd_str_maker(cmd, args)
          proc = Popen(
              cmd_str,
              cwd=cwd,
              stdout=PIPE,
              stderr=PIPE,
              shell=NEED_SHELL,
          )
          # Execute
          stdout, stderr = proc.communicate()
      finally:
          if proc.poll() is None:  # In case we get killed
              proc.terminate()
      return stdout.decode(), stderr.decode(), proc.returncode
  
file_path: nipy/tools/run_log_examples.py
imports: import os
  import re
  import sys
  from argparse import ArgumentParser, RawDescriptionHelpFormatter
  from os.path import abspath, dirname, expanduser, isfile
  from os.path import join
  from os.path import sep
  from subprocess import PIPE, Popen
label_desc: Use image node_id 4 for calling the ProcLogger obj's underlying member method code with example usage: obj.run_pipes(cmd, args, cwd) and returns: stdout,  stderr,  proc