code: def apply_configuration(
      dist: "Distribution", filepath: _Path
  ) -> "Distribution":
      """Apply the configuration from a ``setup.cfg`` file into an existing
      distribution object.
      """
      _apply(dist, filepath)
      dist._finalize_requires()
      return dist
  
imports: import contextlib
  import functools
  import os
  from collections import defaultdict
  from functools import partial
  from functools import wraps
  from typing import TYPE_CHECKING, Callable, Any, Dict, Generic, Iterable, List, Optional, Set, Tuple, TypeVar, Union
  from ..errors import FileError, OptionError
  from ..extern.packaging.markers import default_environment
  from ..extern.packaging.requirements import InvalidRequirement, Requirement
  from ..extern.packaging.specifiers import SpecifierSet
  from ..extern.packaging.version import InvalidVersion, Version
  from ..warnings import SetuptoolsDeprecationWarning
  from .None import expand
label_desc: Use image node_id 2 for calling a global function with example usage: apply_configuration(dist, filepath) and returns: dist