code: def resize_shm_chunk(shm_chunk, needed_capacity):
      new_capacity = max(needed_capacity, 2 * shm_chunk.capacity)
      new_capacity = _align_up(
          new_capacity, SharedBatchWriter.BUFFER_ALIGNMENT
      )
      shm_chunk.resize(new_capacity, trunc=True)
  
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 9 for calling a global function with example usage: resize_shm_chunk(shm_chunk, needed_capacity) without return types