class_docstr: This is like :mod:`pexpect.fdpexpect` but uses the cross-platform python socket api,
  rather than the unix-specific file descriptor api. Thus, it works with
  remote connections on both unix and windows.
class_docstr_tok: ["This","is","like",":","mod",":","`","pexpect.fdpexpect","`","but","uses","the","cross-platform","python","socket","api",",","rather","than","the","unix-specific","file","descriptor","api",".","Thus",",","it","works","with","remote","connections","on","both","unix","and","windows","."]
docstr: This takes an open socket.
docstr_tok: ["This","takes","an","open","socket","."]
code: def __init__(
      self,
      socket: socket.socket,
      args=None,
      timeout=30,
      maxread=2000,
      searchwindowsize=None,
      logfile=None,
      encoding=None,
      codec_errors="strict",
      use_poll=False,
  ):
      """This takes an open socket."""
  
      self.args = None
      self.command = None
      SpawnBase.__init__(
          self,
          timeout,
          maxread,
          searchwindowsize,
          logfile,
          encoding=encoding,
          codec_errors=codec_errors,
      )
      self.socket = socket
      self.child_fd = socket.fileno()
      self.closed = False
      self.name = "<socket %s>" % socket
      self.use_poll = use_poll
  
file_path: catboost/contrib/python/pexpect/py3/pexpect/socket_pexpect.py
imports: import socket
  from contextlib import contextmanager
  from .exceptions import TIMEOUT, EOF
  from .spawnbase import SpawnBase
label_desc: Use image node_id 1 to create a new SocketSpawn object from inherited base classes: SpawnBase with example: obj = SocketSpawn(socket, args, timeout, maxread, searchwindowsize, logfile, encoding, codec_errors, use_poll)