code: def test_collect_init_args():
      class AutomaticArgsParent:
          def __init__(self, anyarg, anykw=42, **kwargs):
              super().__init__()
              self.get_init_args_wrapper()
  
          def get_init_args_wrapper(self):
              frame = inspect.currentframe()
              self.result = collect_init_args(frame, [])
  
      class AutomaticArgsChild(AutomaticArgsParent):
          def __init__(
              self, anyarg, childarg, anykw=42, childkw=42, **kwargs
          ):
              super().__init__(anyarg, anykw=anykw, **kwargs)
  
      my_class = AutomaticArgsChild(
          "test1", "test2", anykw=32, childkw=22, otherkw=123
      )
      assert my_class.result[0] == {
          "anyarg": "test1",
          "anykw": 32,
          "otherkw": 123,
      }
      assert my_class.result[1] == {
          "anyarg": "test1",
          "childarg": "test2",
          "anykw": 32,
          "childkw": 22,
          "otherkw": 123,
      }
  
file_path: pytorch-lightning/tests/tests_pytorch/utilities/test_parsing.py
imports: import inspect
  import threading
  import pytest
  from lightning.pytorch import LightningDataModule, LightningModule, Trainer
  from lightning.pytorch.utilities.parsing import _get_init_args, clean_namespace, collect_init_args, is_picklable, lightning_getattr, lightning_hasattr, lightning_setattr, parse_class_init_keys
  from torch.jit import ScriptModule
label_desc: Use image node_id 9 for calling a global function with example usage: test_collect_init_args() without return types