def METHOD_NAME(
    annots: dict[str, str], module_name: str, localns: Optional[Namespace] = None
) -> dict[str, Any]:
    """Evaluate type annotations that are strings.
    Parameters
    ----------
    annots
        Type annotations to evaluate.
    module_name
        The name of the module that the annotations are defined in, hence
        providing global scope.
    localns
        The local namespace to use for evaluation.
    Returns
    -------
    Actual type hints.
    Examples
    --------
    >>> annots = {'a': 'dict[str, float]', 'b': 'int'}
    >>> evaluate_annotations(annots, __name__)
    {'a': dict[str, float], 'b': <class 'int'>}
    """
    module = sys.modules.get(module_name, None)
    globalns = getattr(module, "__dict__", None)
    return {
        k: eval(v, globalns, localns) if isinstance(v, str) else v  # noqa: PGH001
        for k, v in annots.items()
    }