code: def test_kwonly_args_moved_to_end(self):
      @kw_only_dataclasses.dataclass
      class TestClass:
          a: int = 1
          b: int = kw_only_dataclasses.field(default=2, kw_only=True)
          c: int = 3
  
      params = inspect.signature(TestClass.__init__).parameters
      self.assertEqual(list(params), ["self", "a", "c", "b"])
      self.assertEqual(params["a"].default, 1)
      self.assertEqual(params["b"].default, 2)
      self.assertEqual(params["c"].default, 3)
  
      v1 = TestClass()
      self.assertDictEqual(dataclasses.asdict(v1), dict(a=1, b=2, c=3))
  
      v2 = TestClass(b=20)
      self.assertDictEqual(dataclasses.asdict(v2), dict(a=1, b=20, c=3))
  
      v3 = TestClass(1, 30)
      self.assertDictEqual(dataclasses.asdict(v3), dict(a=1, b=2, c=30))
  
file_path: flax/tests/linen/kw_only_dataclasses_test.py
imports: import dataclasses
  import inspect
  from absl.testing import absltest
  from flax.linen import kw_only_dataclasses
label_desc: Use image node_id 1 for calling the KwOnlyDataclassesTest obj's underlying member method code with example usage: obj.test_kwonly_args_moved_to_end() without return types