class_docstr: Abstract test class for testing model chat code.
class_docstr_tok: ["Abstract","test","class","for","testing","model","chat","code","."]
code: def _remove_non_deterministic_keys(self, actual_state: dict) -> dict:
      # Remove non-deterministic keys from each message
      for message in actual_state["outputs"]["messages"]:
          for field in ["update_id", "timestamp"]:
              if field in message:
                  del message[field]
  
      # TODO: in `self._check_output_key()`, there is other logic for ignoring
      #  keys with non-deterministic values. Consolidate all of that logic here!
      custom_data = self._get_custom_data(actual_state)
      # Delete keys that will change depending on when/where the test is run
      for key in ["model_file"]:
          del custom_data["task_description"][key]
      for key in [
          "datapath",
          "dict_file",
          "model_file",
          "parlai_home",
          "starttime",
      ]:
          if key in custom_data["task_description"]["model_opt"]:
              del custom_data["task_description"]["model_opt"][key]
      for key in ["model_file"]:
          if (
              key
              in custom_data["task_description"]["model_opt"][
                  "override"
              ]
          ):
              del custom_data["task_description"]["model_opt"][
                  "override"
              ][key]
  
      return actual_state
  
imports: import base64
  import datetime
  import json
  import os
  import random
  import threading
  import time
  import unittest
  from io import BytesIO
  from typing import Any, Dict, Optional, Tuple
  from PIL import Image
  from parlai.core.message import Message
  from parlai.core.metrics import Metric
  from parlai.core.params import ParlaiParser
  from parlai.core.loader import load_task_module
  from parlai.crowdsourcing.utils.tests import AbstractParlAIChatTest
  from parlai.tasks.blended_skill_talk.agents import ContextGenerator
label_desc: Use image node_id 1 for calling the AbstractModelChatTest obj's underlying member method code with example usage: obj._remove_non_deterministic_keys(actual_state) and returns: actual_state