code: def test_from_params_handles_base_class_kwargs(self):
      class Foo(FromParams):
          def __init__(self, a: int, b: str = None, **kwargs) -> None:
              self.a = a
              self.b = b
              for key, value in kwargs.items():
                  setattr(self, key, value)
  
      foo = Foo.from_params(Params({"a": 2, "b": "hi"}))
      assert foo.a == 2
      assert foo.b == "hi"
  
      foo = Foo.from_params(
          Params({"a": 2, "b": "hi", "c": {"2": "3"}})
      )
      assert foo.a == 2
      assert foo.b == "hi"
      assert foo.c == {"2": "3"}
  
      class Bar(Foo):
          def __init__(self, a: int, b: str, d: int, **kwargs) -> None:
              super().__init__(a, b=b, **kwargs)
              self.d = d
  
      bar = Bar.from_params(
          Params({"a": 2, "b": "hi", "c": {"2": "3"}, "d": 0})
      )
      assert bar.a == 2
      assert bar.b == "hi"
      assert bar.c == {"2": "3"}
      assert bar.d == 0
  
      class Baz(Foo):
          def __init__(
              self, a: int, b: Optional[str] = "a", **kwargs
          ) -> None:
              super().__init__(a, b=b, **kwargs)
  
      baz = Baz.from_params(Params({"a": 2, "b": None}))
      assert baz.b is None
  
      baz = Baz.from_params(Params({"a": 2}))
      assert baz.b == "a"
  
imports: from typing import Dict, Iterable, List, Mapping, Optional, Set, Tuple, Union
  import pytest
  import torch
  from allennlp.common import Lazy, Params, Registrable
  from allennlp.common.from_params import FromParams, takes_arg, remove_optional, create_kwargs
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import DataLoader, DatasetReader, Tokenizer
  from allennlp.models import Model
  from allennlp.models.archival import load_archive
  from allennlp.common.checks import ConfigurationError
label_desc: Use image node_id 34 for calling the TestFromParams obj's underlying member method code with example usage: obj.test_from_params_handles_base_class_kwargs() without return types