code: def instantiate_class(cls, args, kwargs, extra_kwargs):
      return (
          cls(*args, **kwargs)
          if extra_kwargs is None
          else cls(*args, **kwargs, **extra_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 2 for calling a global function with example usage: instantiate_class(cls, args, kwargs, extra_kwargs) and returns: unknown