class_docstr: Minimal Runner with support for online command output processing
  
  It aims to be as simple as possible, providing only essential
  functionality.
class_docstr_tok: ["Minimal","Runner","with","support","for","online","command","output","processing","It","aims","to","be","as","simple","as","possible",",","providing","only","essential","functionality","."]
docstr: Parameters
  ----------
  cwd : str or path-like, optional
    If given, commands are executed with this path as PWD,
    the PWD of the parent process is used otherwise.
  env : dict, optional
    Environment to be used for command execution. If `None` is provided,
    the current process environment is inherited by the sub-process. If
    a mapping is provided, it will constitute the complete environment of
    the sub-process, i.e.  no values from the environment of the current
    process will be inherited. If `env` and `cwd` are given, 'PWD' in the
    environment is set to the string-value of `cwd`.
docstr_tok: ["Parameters","--","--","--","--","--","cwd",":","str","or","path-like",",","optional","If","given",",","commands","are","executed","with","this","path","as","PWD",",","the","PWD","of","the","parent","process","is","used","otherwise",".","env",":","dict",",","optional","Environment","to","be","used","for","command","execution",".","If","`","None","`","is","provided",",","the","current","process","environment","is","inherited","by","the","sub-process",".","If","a","mapping","is","provided",",","it","will","constitute","the","complete","environment","of","the","sub-process",",","i.e",".","no","values","from","the","environment","of","the","current","process","will","be","inherited",".","If","`","env","`","and","`","cwd","`","are","given",",","'PWD","'","in","the","environment","is","set","to","the","string-value","of","`","cwd","`","."]
code: def __init__(
      self, cwd: str | PathLike | None = None, env: dict | None = None
  ):
      """
      Parameters
      ----------
      cwd : str or path-like, optional
        If given, commands are executed with this path as PWD,
        the PWD of the parent process is used otherwise.
      env : dict, optional
        Environment to be used for command execution. If `None` is provided,
        the current process environment is inherited by the sub-process. If
        a mapping is provided, it will constitute the complete environment of
        the sub-process, i.e.  no values from the environment of the current
        process will be inherited. If `env` and `cwd` are given, 'PWD' in the
        environment is set to the string-value of `cwd`.
      """
      self.env = env
      self.cwd = cwd
  
file_path: datalad/datalad/runner/runner.py
imports: from __future__ import annotations
  import logging
  from os import PathLike
  from queue import Queue
  from typing import IO, cast
  from .protocol import WitlessProtocol
  from .coreprotocols import NoCapture
  from .exception import CommandError
  from .nonasyncrunner import ThreadedRunner, _ResultGenerator
  from .protocol import GeneratorMixIn
label_desc: Use image node_id 1 to create a new WitlessRunner object from inherited base classes: object with example: obj = WitlessRunner(cwd, env)