code: def _optimize(func, optimize=True):
      """Create IRModule and run identity optimizer pass."""
      func = func.with_attr("Compiler", "ethos-u")
      mod = tvm.IRModule.from_expr(func)
      mod = relay.transform.InferType()(mod)
      if optimize:
          mod = IdentityOptimizer()(mod)
      entry = mod["main"]
      return entry if isinstance(func, relay.Function) else entry.body
  
imports: import pytest
  import tensorflow
  import tvm
  from tvm import relay
  from tvm.relay.op.contrib.ethosu import partition_for_ethosu
  from tvm.relay.backend.contrib.ethosu.codegen import relay_to_tir
  from tvm.relay.backend.contrib.ethosu.codegen import IdentityOptimizer
  from .None import infra
label_desc: Use image node_id 1 for calling a global function with example usage: _optimize(func, optimize) and returns: unknown