code: def show_search_space(config_space, printable):
      search_space = {}
      for _, name in enumerate(config_space.space_map):
          curr = config_space.space_map[name]
          if curr.__class__ == tvm.autotvm.task.space.SplitSpace:
              search_space[name] = {
                  "_type": "factor",
                  "_value": [curr.product, curr.num_output],
              }
          elif (
              curr.__class__ == tvm.autotvm.task.space.OtherOptionSpace
          ):
              search_space[name] = {
                  "_type": "choice",
                  "_value": [x.val for x in curr.entities],
              }
          else:
              raise Exception(
                  "Cannot recognize search space type: %s"
                  % (config_space.space_map[name].__class__)
              )
      json_space = json.dumps(search_space)
      print("\n>> Search Space = %s" % json_space)
      if printable:
          print("\n>> Writing Search Space to './search_space.json'..")
          with open("search_space.json", "w") as fp:
              fp.write(json_space)
          print("\n>> Done")
          sys.exit(0)
  
imports: import numpy
  import tvm
  import logging
  import math
  import re
  import sys, time, subprocess, os, random, hashlib
  from tvm import autotvm
  import topi
  import json
  from topi.util import get_const_tuple
  import importlib
  from tvm.autotvm.task.dispatcher import ApplyConfig
  from tvm.autotvm.task import ConfigEntity
  from threading import Timer
label_desc: Use image node_id 2 for calling a global function with example usage: show_search_space(config_space, printable) without return types