code: def read_tcp_size(conn, size):
      """Read `size` number of bytes from `conn`, retrying as needed."""
      chunks = []
      bytes_read = 0
      while bytes_read < size:
          chunk = conn.recv(size - bytes_read)
          if not chunk:
              if bytes_read > 0:
                  logging.warning(
                      "Incomplete read: %s of %s.", bytes_read, size
                  )
              return
          chunks.append(chunk)
          bytes_read += len(chunk)
      return b"".join(chunks)
  
imports: import binascii
  import collections
  import hashlib
  import json
  import os
  import shutil
  import socket
  import struct
  import subprocess
  import threading
  import time
  from absl import logging
  from pysc2 import run_configs
  from pysc2.env import sc2_env
  from pysc2.lib import features
  from pysc2.lib import run_parallel
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 9 for calling a global function with example usage: read_tcp_size(conn, size) and returns: bytes