code: def import_optional_dependency(name: str, extra: str = ""):
      """
      Import an optional dependency.
  
      Adapted from pandas.compat._optional::import_optional_dependency
  
      Raises a formatted ImportError if the module is not present.
  
      Parameters
      ----------
      name : str
          The module name.
      extra : str
          Additional text to include in the ImportError message.
      Returns
      -------
      module
      """
      msg = """Missing optional dependency '{name}'. {extra}  "
          "Use pip or conda to install {name}.""".format(
          name=name, extra=extra
      )
  
      if not isinstance(name, str):
          raise ValueError(
              "Invalid module name: '{name}'; must be a string".format(
                  name=name
              )
          )
  
      try:
          module = importlib.import_module(name)
  
      except ImportError:
          raise ImportError(msg) from None
  
      return module
  
imports: from packaging.version import Version
  import importlib
  import pandas
  import shapely
  import shapely.geos
label_desc: Use image node_id 1 for calling a global function with example usage: import_optional_dependency(name, extra) and returns: module