class_docstr: Implementation. Captures batches in JSON format, returns
  also in JSON format.
docstr: Splits the batched output into mini-batches and returns JSON
code: def _batch_to_json(self, batch, lengths):
      """
      Splits the batched output into mini-batches and returns JSON
      """
      outputs = []
      cursor = 0
      for length in lengths:
          cursor_end = cursor + length
  
          mini_batch = batch[cursor:cursor_end]
          outputs.append(self._to_json(mini_batch))
  
          cursor = cursor_end
      return outputs
  
file_path: serve/ts/torch_handler/request_envelope/json.py
imports: import json
  from base64 import b64decode
  from itertools import chain
  from .base import BaseEnvelope
label_desc: Use image node_id 5 for calling the JSONEnvelope obj's underlying member method code with example usage: obj._batch_to_json(batch, lengths) and returns: outputs