code: def count(prelude, n):
      """Takes a ConstructorValue corresponding to a nat ADT
      and converts it into a Python integer. This is an example of
      using an ADT value in Python.
      """
      assert isinstance(n, ConstructorValue)
      _, z, s = prelude.mod.get_type("nat")
      if n.tag == z.tag:
          return 0
      assert n.tag == s.tag
      return 1 + count(prelude, n.fields[0])
  
imports: from tvm.relay.backend.interpreter import ConstructorValue
label_desc: Use image node_id 2 for calling a global function with example usage: count(prelude, n) and returns: unknown, int