code: def run(args, echo=True, echo2=True, shell=False, cwd=None, env=None):
      
      if not callable(echo):
          echo = On() if echo else Off()
  
      if not callable(echo2):
          echo2 = On() if echo2 else Off()
  
      process = Popen(
          args,
          stdout=PIPE,
          stderr=PIPE,
          shell=shell,
          cwd=cwd,
          env=env
      )
  
      with background_thread(tee2, (process, echo2)):
          lines = tee(process, echo)
  
      return process.returncode, lines
docs: Run 'args' and return a two-tuple of exit code and lines read.
  
      If 'echo' is True, the stdout stream is echoed to sys.stdout.
      If 'echo2' is True, the stderr stream is echoed to sys.stderr.
  
      The 'echo' and 'echo2' arguments may be callables, in which
      case they are used as tee filters.
  
      If 'shell' is True, args are executed via the shell.
      The 'cwd' argument causes the child process to be executed in cwd.
      The 'env' argument allows to pass a dict replacing os.environ.