code: def connect(command, data=None, env=None, cwd=None):
      
  
      # TODO: support piped commands
      command_str = expand_args(command).pop()
      environ = dict(os.environ)
      environ.update(env or {})
  
      process = subprocess.Popen(command_str,
          universal_newlines=True,
          shell=False,
          env=environ,
          stdin=subprocess.PIPE,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
          bufsize=0,
          cwd=cwd,
      )
  
      return ConnectedCommand(process=process)
docs: Spawns a new process from the given command.