def _data_key(self, key: Union[str, Optional, Or, AtMostOne]) -> Iterator[str]:
        """Map a key from the ``validator`` dictionary to the corresponding key(s) in the ``data`` dictionary.

        :param key: key from the ``validator`` attribute.

        :yields: keys that should be used to access corresponding value in the ``data`` attribute.
        """
        data = cast(Dict[Any, Any], self.data)

        # If the key was defined as an `Optional` object in `validator` attribute, then its name is the key to access
        # the `data` dictionary.
        if isinstance(key, Optional):
            yield key.name
        # If the key was defined as a `str` object in `validator` attribute, then it is already the final key
        # to access the `data` dictionary.
        elif isinstance(key, str):
            yield key
        # If the key was defined as an `Or` object in `validator` attribute, then each of its values are
        # the keys to access the `data` dictionary.
        elif isinstance(key, Or):
            # At least one of the `Or` entries should be available in the `data` dictionary. If we find at least
            # one of them in `data`, then we return all found entries so the caller method can validate them all.
            if any([item in data for item in key.args]):
                for item in key.args:
                    if item in data:
                        yield item
            # If none of the `Or` entries is available in the `data` dictionary, then we return all entries so the
            # caller method will issue errors that they are all absent.
            else:
                for item in key.args:
                    yield item
        # If the key was defined as a `AtMostOne` object in `validator` attribute, then each of its values
        # are the keys to access the `data` dictionary.
        elif isinstance(key, AtMostOne):  # pyright: ignore [reportUnnecessaryIsInstance]
            # Yield back all of the entries from the `data` dictionary, each will be validated and then counted
            # to inform us if we've provided too many
            for item in key.args:
                if item in data:
                    yield item
Map a key from the ``validator`` dictionary to the corresponding key(s) in the ``data`` dictionary.

        :param key: key from the ``validator`` attribute.

        :yields: keys that should be used to access corresponding value in the ``data`` attribute.
        
patroni/validator.py