code: def get_example_args(
      module_cls, constructor_arg_db, extra_kwargs=None
  ):
      assert (
          module_cls in constructor_arg_db
      ), f"No entry for {module_cls} in the constructor arg DB. Please add it to pass these tests."
      args, kwargs = constructor_arg_db[module_cls]
      extra_kwargs = {} if extra_kwargs is None else extra_kwargs
  
      # Recursively instantiate args / kwargs that are class objects.
      args = [
          instantiate_class(
              arg,
              *get_example_args(arg, constructor_arg_db),
              extra_kwargs=extra_kwargs,
          )
          if inspect.isclass(arg)
          else torch.nn.Parameter(arg.to(**extra_kwargs))
          if isinstance(arg, torch.nn.Parameter)
          else arg
          for arg in args
      ]
      kwargs = {
          k: instantiate_class(
              v,
              *get_example_args(v, constructor_arg_db),
              extra_kwargs=extra_kwargs,
          )
          if inspect.isclass(v)
          else torch.nn.Parameter(v.to(*extra_kwargs))
          if isinstance(v, torch.nn.Parameter)
          else v
          for k, v in kwargs.items()
      }
      kwargs.update(extra_kwargs)
      return args, kwargs
  
file_path: pytorch/test/test_module_init.py
imports: import inspect
  import torch
  from unittest import mock
  from unittest.mock import MagicMock, patch
  from torch.testing._internal.common_dtype import floating_types
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, dtypes
  from torch.testing._internal.common_quantization import skipIfNoFBGEMM
  from torch.testing._internal.common_utils import TestCase, run_tests
label_desc: Use image node_id 4 for calling a global function with example usage: get_example_args(module_cls, constructor_arg_db, extra_kwargs) and returns: args,  kwargs