class_docstr: Class to run scripts and return output
  
  Finds local scripts and local modules if running in the development
  directory, otherwise finds system scripts and modules.
docstr: Init ScriptRunner instance
  
  Parameters
  ----------
  script_sdir : str, optional
      Name of subdirectory in top-level directory (directory containing
      setup.py), to find scripts in development tree.  Typically
      'scripts', but might be 'bin'.
  module_sdir : str, optional
      Name of subdirectory in top-level directory (directory containing
      setup.py), to find main package directory.
  debug_print_vsr : str, optional
      Name of environment variable that indicates whether to do debug
      printing or no.
  output_processor : callable
      Callable to run on the stdout, stderr outputs before returning
      them.  Use this to convert bytes to unicode, strip whitespace, etc.
docstr_tok: ["Init","ScriptRunner","instance","Parameters","--","--","--","--","--","script_sdir",":","str",",","optional","Name","of","subdirectory","in","top-level","directory","(","directory","containing","setup.py",")",",","to","find","scripts","in","development","tree",".","Typically","'scripts","'",",","but","might","be","'bin","'",".","module_sdir",":","str",",","optional","Name","of","subdirectory","in","top-level","directory","(","directory","containing","setup.py",")",",","to","find","main","package","directory",".","debug_print_vsr",":","str",",","optional","Name","of","environment","variable","that","indicates","whether","to","do","debug","printing","or","no",".","output_processor",":","callable","Callable","to","run","on","the","stdout",",","stderr","outputs","before","returning","them",".","Use","this","to","convert","bytes","to","unicode",",","strip","whitespace",",","etc","."]
code: def __init__(
      self,
      script_sdir="scripts",
      module_sdir=MY_PACKAGE,
      debug_print_var=None,
      output_processor=lambda x: x,
  ):
      """Init ScriptRunner instance
  
      Parameters
      ----------
      script_sdir : str, optional
          Name of subdirectory in top-level directory (directory containing
          setup.py), to find scripts in development tree.  Typically
          'scripts', but might be 'bin'.
      module_sdir : str, optional
          Name of subdirectory in top-level directory (directory containing
          setup.py), to find main package directory.
      debug_print_vsr : str, optional
          Name of environment variable that indicates whether to do debug
          printing or no.
      output_processor : callable
          Callable to run on the stdout, stderr outputs before returning
          them.  Use this to convert bytes to unicode, strip whitespace, etc.
      """
      self.local_script_dir = local_script_dir(script_sdir)
      self.local_module_dir = local_module_dir(module_sdir)
      if debug_print_var is None:
          debug_print_var = f"{module_sdir.upper()}_DEBUG_PRINT"
      self.debug_print = os.environ.get(debug_print_var, False)
      self.output_processor = output_processor
  
file_path: nibabel/nibabel/tests/scriptrunner.py
imports: import os
  import sys
  from os.path import dirname, isdir, isfile
  from os.path import join
  from os.path import pathsep, realpath
  from subprocess import PIPE, Popen
label_desc: Use image node_id 1 to create a new ScriptRunner object  with example: obj = ScriptRunner(script_sdir, module_sdir, debug_print_var, output_processor)