code: def create_dummy_func(func, dependency):
      """
      When a dependency of a function is not available, create a dummy function which throws ImportError when used.
  
      Args:
          func (str): name of the function.
          dependency (str or list[str]): name(s) of the dependency.
  
      Returns:
          function: a function object
      """
      assert not building_rtfd()
  
      if isinstance(dependency, (list, tuple)):
          dependency = ",".join(dependency)
  
      def _dummy(*args, **kwargs):
          raise ImportError(
              "Cannot import '{}', therefore '{}' is not available".format(
                  dependency, func
              )
          )
  
      return _dummy
  
file_path: tensorpack/tensorpack/utils/develop.py
imports: import functools
  import importlib
  import os
  import types
  from collections import defaultdict
  from datetime import datetime
  import six
  from .None import logger
label_desc: Use image node_id 2 for calling a global function with example usage: create_dummy_func(func, dependency) and returns: _dummy