code: def recvall(s: socket.socket, bufsize: int) -> str:
      received_buffer = s.recv(bufsize)
      received_num_bytes = len(received_buffer)
      while received_num_bytes > 0 and len(received_buffer) < bufsize:
          if received_buffer[-1] == NEWLINE_CHAR_BYTE:
              break
          tmp_buffer = s.recv(bufsize)
          received_num_bytes = len(tmp_buffer)
          received_buffer = received_buffer + tmp_buffer
      return received_buffer.decode(TEXT_ENCODING)
  
file_path: vowpal_wabbit/utl/active_interactor.py
imports: import socket
  import argparse
  from typing import Callable, ContextManager, Optional, TextIO
  import contextlib
label_desc: Use image node_id 1 for calling a global function with example usage: recvall(s, bufsize) and returns: received_buffer