class_docstr: Test ParlaiParser.
class_docstr_tok: ["Test","ParlaiParser","."]
code: def test_parse_kwargs(self):
      parser = ParlaiParser(True, True)
  
      # implied args from the model
      opt = parser.parse_kwargs(
          model="transformer/generator", relu_dropout=0.3
      )
      assert opt["relu_dropout"] == 0.3
      assert opt["model"] == "transformer/generator"
      assert "n_heads" in opt
  
      # bad types
      with self.assertRaises(ValueError):
          parser = ParlaiParser(True, True)
          parser.parse_kwargs(
              model="transformer/generator", relu_dropout="foo"
          )
  
      # nonexistant args without model
      with self.assertRaises(KeyError):
          parser = ParlaiParser(True, True)
          parser.parse_kwargs(fake_arg="foo")
  
      # nonexistant args with model
      with self.assertRaises(KeyError):
          parser = ParlaiParser(True, True)
          parser.parse_kwargs(
              model="transformer/generator", fake_arg="foo"
          )
  
imports: import os
  import json
  import unittest
  from parlai.core.params import ParlaiParser
  import parlai.core.agents
  import parlai.utils.testing
label_desc: Use image node_id 6 for calling the TestParlaiParser obj's underlying member method code with example usage: obj.test_parse_kwargs() without return types