code: def load_next(mod, altmod, name, buf):
      """
      mod, name, buf = load_next(mod, altmod, name, buf)
  
      altmod is either None or same as mod
      """
  
      if len(name) == 0:
          # completely empty module name should only happen in
          # 'from . import' (or '__import__("")')
          return mod, None, buf
  
      dot = name.find(".")
      if dot == 0:
          raise ValueError("Empty module name")
  
      if dot < 0:
          subname = name
          next = None
      else:
          subname = name[:dot]
          next = name[dot + 1 :]
  
      if buf != "":
          buf += "."
      buf += subname
  
      result = import_submodule(mod, subname, buf)
      if result is None and mod != altmod:
          result = import_submodule(altmod, subname, subname)
          if result is not None:
              buf = subname
  
      if result is None:
          raise ImportError("No module named %.200s" % name)
  
      return result, next, buf
  
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 3 for calling a global function with example usage: load_next(mod, altmod, name, buf) and returns: result,  next,  buf, mod,  None,  buf