parameters: (master_fd, master_read=_read, stdin_read=_read)
docstring: Parent copy loop.
      Copies
              pty master -> standard output   (master_read)
              standard input -> pty master    (stdin_read)
docstring_summary: Parent copy loop.
      Copies
              pty master -> standard output   (master_read)
              standard input -> pty master    (stdin_read)
docstring_tokens: Parent copy loop . Copies pty master - > standard output ( master_read ) standard input - > pty master ( stdin_read )
function: def _copy(master_fd, master_read=_read, stdin_read=_read):
      """Parent copy loop.
      Copies
              pty master -> standard output   (master_read)
              standard input -> pty master    (stdin_read)"""
      fds = [master_fd, STDIN_FILENO]
      while True:
          rfds, wfds, xfds = select(fds, [], [])
          if master_fd in rfds:
              data = master_read(master_fd)
              if not data:  # Reached EOF.
                  fds.remove(master_fd)
              else:
                  os.write(STDOUT_FILENO, data)
          if STDIN_FILENO in rfds:
              data = stdin_read(STDIN_FILENO)
              if not data:
                  fds.remove(STDIN_FILENO)
              else:
                  _writen(master_fd, data)
function_tokens: def _copy ( master_fd , master_read = _read , stdin_read = _read ) : fds = [ master_fd , STDIN_FILENO ] while True : rfds , wfds , xfds = select ( fds , [ ] , [ ] ) if master_fd in rfds : data = master_read ( master_fd ) if not data : # Reached EOF. fds . remove ( master_fd ) else : os . write ( STDOUT_FILENO , data ) if STDIN_FILENO in rfds : data = stdin_read ( STDIN_FILENO ) if not data : fds . remove ( STDIN_FILENO ) else : _writen ( master_fd , data )