code: def assert_op_count_match(program, expect, op=None, verbose=False):
      """
      Assert number of ops match expected number. If op is not specified,
      Count total number of ops and match with expect.
      """
      if verbose:
          print(program)
  
      count = 0
      for _, func in program.functions.items():
          for o in func.operations:
              if not op:
                  count += 1
              elif o.op_type.lower() == op.lower():
                  count += 1
          np.testing.assert_equal(count, expect)
  
imports: import logging
  import numpy
  import copy
  import coremltools
  from coremltools import converters
  from coremltools.converters.mil import converter
  from coremltools.converters.mil.mil import Program, Function
  from coremltools.converters.mil.mil.passes.pass_registry import PASS_REGISTRY
  from coremltools._deps import _IS_MACOS
label_desc: Use image node_id 1 for calling a global function with example usage: assert_op_count_match(program, expect, op, verbose) without return types