class_docstr: ArrowDatasetTest
class_docstr_tok: ["ArrowDatasetTest"]
docstr: test_arrow_socket_dataset
code: def test_arrow_socket_dataset(self):
      """test_arrow_socket_dataset"""
      import tensorflow_io.arrow as arrow_io
  
      truth_data = TruthData(
          self.scalar_data + self.list_data,
          self.scalar_dtypes + self.list_dtypes,
          self.scalar_shapes + self.list_shapes,
      )
  
      batch = self.make_record_batch(truth_data)
  
      sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      sock.bind(("127.0.0.1", 0))
      sock.listen(1)
      host_addr, port = sock.getsockname()
      host = f"{host_addr}:{port}"
  
      def run_server(num_batches):
          conn, _ = sock.accept()
          outfile = conn.makefile(mode="wb")
          writer = pa.RecordBatchStreamWriter(outfile, batch.schema)
          for _ in range(num_batches):
              writer.write_batch(batch)
          writer.close()
          outfile.close()
          conn.close()
          sock.close()
  
      # test with multiple batches, construct from schema
      num_batches = 2
      server = threading.Thread(target=run_server, args=(num_batches,))
      server.start()
  
      dataset = arrow_io.ArrowStreamDataset.from_schema(
          host, batch.schema
      )
      truth_data_mult = TruthData(
          [d * num_batches for d in truth_data.data],
          truth_data.output_types,
          truth_data.output_shapes,
      )
      self.run_test_case(dataset, truth_data_mult)
  
      server.join()
  
imports: from collections import namedtuple
  import io
  import os
  import socket
  import tempfile
  import threading
  import pytest
  import pyarrow
  import numpy.testing
  import tensorflow
  import tensorflow_io
label_desc: Use image node_id 7 for calling the ArrowDatasetTest obj's underlying member method code with example usage: obj.test_arrow_socket_dataset() without return types