code: def _find_optional_dependency(
      package_name: str,
      optional_dependencies: dict = optional_dependencies,
  ) -> Tuple[str, str]:
      """
      Find if a package is an optional dependency. If True, find the version and
      the extension it belongs to.
  
      Parameters
      ----------
      package_name : str
          Name of the package to check.
      optional_dependencies : dict, default `optional_dependencies`
          Skforecast optional dependencies.
  
      Returns
      -------
      extra: str
          Name of the extra extension where the optional dependency is needed.
      package_version: srt
          Name and versions of the dependency.
  
      """
  
      for extra, packages in optional_dependencies.items():
          package_version = [
              package for package in packages if package_name in package
          ]
          if package_version:
              return extra, package_version[0]
  
imports: from typing import Union, Any, Optional, Tuple, Callable
  import warnings
  import importlib
  import joblib
  import numpy
  import pandas
  import sklearn
  import sklearn.pipeline
  import sklearn.linear_model
  from sklearn.compose import ColumnTransformer
  from sklearn.exceptions import NotFittedError
  import inspect
  from copy import deepcopy
  import skforecast
  from ..exceptions import MissingValuesExogWarning
  from ..exceptions import DataTypeWarning
  from ..exceptions import IgnoredArgumentWarning
  from ..exceptions import SkforecastVersionWarning
label_desc: Use image node_id 22 for calling a global function with example usage: _find_optional_dependency(package_name, optional_dependencies) and returns: extra,  package_version