code: def import_package(rel_path_to_package, package_name):
      """Imports a Python package into the current namespace.
  
      Parameters
      ----------
      rel_path_to_package : str
          Path to the package containing director relative from this script's
          directory.
      package_name : str
          The name of the package to be imported.
  
      Returns
      ---------
      package : The imported package object.
  
      """
      try:
          curr_dir = os.path.dirname(os.path.realpath(__file__))
      except NameError:
          curr_dir = os.path.dirname(os.path.realpath(os.getcwd()))
      package_path = os.path.join(curr_dir, rel_path_to_package)
      if package_path not in sys.path:
          sys.path = [package_path] + sys.path
      package = __import__(package_name)
      return package
  
file_path: mlxtend/docs/make_api.py
imports: import inspect
  import os
  import pkgutil
  import shutil
  import sys
label_desc: Use image node_id 5 for calling a global function with example usage: import_package(rel_path_to_package, package_name) and returns: package