code: def delete_asserts(tfssa):
      """
      Delete all nodes that lead only to assertions.
      """
      delete_count = 0
      for f in tfssa.functions.values():
          memo = {}
          for n in f.graph:
              _all_assert_leaves(f.graph, n, memo)
          for m in memo:
              if memo[m]:
                  delete_count += 1
                  delete_node(f.graph, m)
      logger.debug("%d assert nodes deleted", delete_count)
      return delete_count
  
imports: import sys
  from coremltools import _logger
  from ..basic_graph_ops import delete_node
label_desc: Use image node_id 2 for calling a global function with example usage: delete_asserts(tfssa) and returns: delete_count