code: def _reset_register(keep={"gokart", "luigi"}):
      """reset luigi.task_register.Register._reg everytime gokart.build called to avoid TaskClassAmbigiousException"""
      luigi.task_register.Register._reg = [
          x
          for x in luigi.task_register.Register._reg
          if (
              (
                  x.__module__.split(".")[0] in keep
              )  # keep luigi and gokart
              or (issubclass(x, gokart.PandasTypeConfig))
          )  # PandasTypeConfig should be kept
      ]
  
file_path: gokart/gokart/build.py
imports: import logging
  from logging import getLogger
  from typing import Any, Optional
  import luigi
  import gokart
  from gokart.task import TaskOnKart
label_desc: Use image node_id 2 for calling a global function with example usage: _reset_register(keep) without return types