def __setitem__(self, key, policy):
        """Insert `DTypePolicy` to the `DTypePolicyMap`.

        Args:
            key: String key for the `DTypePolicy`.
            policy: The `DTypePolicy`.
        """
        if key in self._policy_map:
            raise ValueError(
                f"{key} already exist in the DTypePolicyMap with "
                f"value {self._policy_map[key]}. Please make sure to "
                "not use duplicated keys."
            )
        try:
            policy = dtype_policies.get(policy)
        except Exception:
            raise ValueError(
                "Cannot interpret the assigned value by "
                "`keras.dtype_policies.get`. "
                f"Received: {policy} of type {type(policy)}"
            )
        self._policy_map[key] = policy
Insert `DTypePolicy` to the `DTypePolicyMap`.

        Args:
            key: String key for the `DTypePolicy`.
            policy: The `DTypePolicy`.
        
keras/src/dtype_policies/dtype_policy_map.py