code: def ensure_fromlist(mod, fromlist, buf, recursive):
      """Handle 'from module import a, b, c' imports."""
      if not hasattr(mod, "__path__"):
          return
      for item in fromlist:
          if not hasattr(item, "rindex"):
              raise TypeError("Item in ``from list'' not a string")
          if item == "*":
              if recursive:
                  continue  # avoid endless recursion
              try:
                  all = mod.__all__
              except AttributeError:
                  pass
              else:
                  ret = ensure_fromlist(mod, all, buf, 1)
                  if not ret:
                      return 0
          elif not hasattr(mod, item):
              import_submodule(mod, item, buf + "." + item)
  
file_path: catboost/contrib/python/ipython/py2/IPython/lib/deepreload.py
imports: from __future__ import print_function
  from contextlib import contextmanager
  import imp
  import sys
  from types import ModuleType
  from warnings import warn
  from IPython.utils.py3compat import builtin_mod, builtin_mod_name
label_desc: Use image node_id 6 for calling a global function with example usage: ensure_fromlist(mod, fromlist, buf, recursive) and returns: int