code: def read(self, count, timeout=None):
      result = bytearray(count)
      with memoryview(result) as m:
          while count > 0:
              try:
                  if timeout is not None:
                      # Yes, technically should divide by RECV_COUNT...
                      self._socket.settimeout(timeout)
                  nbytes = __try_op__(
                      "receive",
                      self._sock.recv_into,
                      RECV_RETRY,
                      m,
                      min(count, MAX_MSG_SIZE),
                  )
                  # If we don't receive anything, we reached EOF
                  if nbytes == 0:
                      raise socket.error()
                  count -= nbytes
                  m = m[nbytes:]
              except socket.timeout:
                  continue
              except socket.error as e:
                  self.close()
                  raise EOFError(e)
      return result
  
file_path: metaflow/metaflow/plugins/env_escape/communication/socket_bytestream.py
imports: import errno
  import socket
  import sys
  from .bytestream import ByteStream
  from .utils import __try_op__
label_desc: Use image node_id 4 for calling the SocketByteStream obj's underlying member method code with example usage: obj.read(count, timeout) and returns: result