class_docstr: Writer object that saves experiences in JSON file chunks.
code: def write(self, sample_batch: SampleBatchType):
      start = time.time()
      data = _to_json(sample_batch, self.compress_columns)
      f = self._get_file()
      f.write(data)
      f.write("\n")
      if hasattr(f, "flush"):  # legacy smart_open impls
          f.flush()
      self.bytes_written += len(data)
      logger.debug(
          "Wrote {} bytes to {} in {}s".format(
              len(data), f, time.time() - start
          )
      )
  
imports: from datetime import datetime
  import json
  import logging
  import numpy
  import os
  from urllib.parse import urlparse
  import time
  from ray.air._internal.json import SafeFallbackEncoder
  from ray.rllib.policy.sample_batch import MultiAgentBatch
  from ray.rllib.offline.io_context import IOContext
  from ray.rllib.offline.output_writer import OutputWriter
  from ray.rllib.utils.annotations import override, PublicAPI
  from ray.rllib.utils.compression import pack, compression_supported
  from ray.rllib.utils.typing import FileType, SampleBatchType
  from typing import Any, Dict, List
label_desc: Use image node_id 2 for calling the JsonWriter obj's underlying member method code with example usage: obj.write(sample_batch) without return types