code: def _register_task_schedule(name, func=None):
      """Register schedule function to autotvm task
  
      Parameters
      ----------
      name: str
          The task name
  
      func: None or callable
          If it is None, return a decorator.
          If is callable, decorate this function.
  
      Returns
      -------
      decorator: callable
          A decorator
      """
  
      def _do_reg(f):
          if name not in TASK_TABLE:
              TASK_TABLE[name] = TaskTemplate()
          tmpl = TASK_TABLE[name]
          if tmpl.fschedule is not None:
              raise ValueError(
                  f"Schedule is already registered in autoTVM task {name}"
              )
          tmpl.fschedule = f
          return f
  
      if func:
          return _do_reg(func)
      return _do_reg
  
imports: import functools
  import numpy
  from tvm import runtime
  from tvm.ir import container
  from tvm.target import Target
  from tvm.te import placeholder, tensor
  from tvm.tir import expr
  from ..utils import get_const_int, get_const_tuple
  from .dispatcher import ApplyConfig, DispatchContext
  from .space import ConfigSpace
label_desc: Use image node_id 6 for calling a global function with example usage: _register_task_schedule(name, func) and returns: _do_reg, f, _do_reg