code: def verify_single_allocation(stmt, alloc_size=None):
      num_alloc = [0]
      alloc_extents = []
  
      def verify(n):
          if (
              isinstance(n, tvm.tir.Allocate)
              and n.buffer_var.type_annotation.storage_scope
              == "shared.dyn"
          ):
              num_alloc[0] += 1
              alloc_extents.append(n.extents[0])
  
      tvm.tir.stmt_functor.post_order_visit(stmt, verify)
      assert num_alloc[0] == 1
  
      if alloc_size:
          assert alloc_extents[0] == alloc_size
  
imports: import numpy
  import tvm
  import tvm.testing
  from tvm import te
  from tvm.driver.build_module import schedule_to_module
  from tvm.topi.math import cast
  from tvm.script import tir
label_desc: Use image node_id 2 for calling a global function with example usage: verify_single_allocation(stmt, alloc_size) without return types