def _is_valid_key(self, key):
        """Validate a proposed dictionary key

        Parameters
        ----------
        key : object

        Returns
        -------
        boolean
        """
        # The key should be a tuple
        if not isinstance(key, tuple):
            return False

        # The tuple should be a triplet
        if len(key) != 3:
            return False

        # The triplet should be a pair of axelrod.Player sublclasses and an
        # integer
        try:
            if not (
                issubclass(key[0], Player) and
                issubclass(key[1], Player) and
                isinstance(key[2], int)
            ):
                return False
        except __HOLE__:
            return False

        # Each Player class should be deterministic
        if key[0].classifier['stochastic'] or key[1].classifier['stochastic']:
            return False

        return True
dataset/ETHPy150Open Axelrod-Python/Axelrod/axelrod/deterministic_cache.py/DeterministicCache._is_valid_key