code: def _to_json(
      batch: SampleBatchType, compress_columns: List[str]
  ) -> str:
      out = _to_json_dict(batch, compress_columns)
      return json.dumps(out, cls=SafeFallbackEncoder)
  
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 3 for calling a global function with example usage: _to_json(batch, compress_columns) and returns: json