class_docstr: SharedBatchWriter can serialize and write batch into given shared
  memory chunk (``shm_chunk``).
docstr: Calculate metadata and total size of data to be serialized
code: def _prepare_samples_meta(self, samples):
      """Calculate metadata and total size of data to be serialized"""
      data_size = 0
  
      def make_meta(np_array):
          nonlocal data_size
          offset = _align_up(data_size, self.SAMPLE_ALIGNMENT)
          data_size = offset + np_array.nbytes
          return SampleMeta(
              offset, np_array.shape, np_array.dtype, np_array.nbytes
          )
  
      meta = [_apply_to_sample(make_meta, sample) for sample in samples]
      return meta, data_size
  
imports: import os
  from nvidia.dali._multiproc import shared_mem
  from nvidia.dali._multiproc.messages import ShmMessageDesc
  from nvidia.dali._utils.external_source_impl import assert_cpu_sample_data_type, sample_to_numpy
  import pickle
label_desc: Use image node_id 2 for calling the SharedBatchWriter obj's underlying member method code with example usage: obj._prepare_samples_meta(samples) and returns: meta,  data_size, SampleMeta