code: def assert_state_buffers_parameters_equal(
      model_1: nn.Module,
      model_2: nn.Module,
      check_named_buffers: bool = True,
      check_named_parameters: bool = True,
      check_state_dict: bool = True,
  ) -> None:
      """
      Checks to see if the keys of top level PyTorch API calls are the same
      between two modules.
      """
  
      model_characteristics = {}
      model_characteristics["model_1"] = get_state_buffers_parameters(
          model_1
      )
      model_characteristics["model_2"] = get_state_buffers_parameters(
          model_2
      )
  
      assert (
          not check_named_buffers
          or model_characteristics["model_1"]["named_buffers"].keys()
          == model_characteristics["model_2"]["named_buffers"].keys()
      ), "named buffers keys are not the same"
  
      assert (
          not check_named_parameters
          or model_characteristics["model_1"]["named_parameters"].keys()
          == model_characteristics["model_2"]["named_parameters"].keys()
      ), f"named parameter keys are not the same {model_characteristics['model_1']['named_parameters'].keys()} vs {model_characteristics['model_2']['named_parameters'].keys()}"
  
      assert (
          not check_state_dict
          or model_characteristics["model_1"]["state_dict"].keys()
          == model_characteristics["model_2"]["state_dict"].keys()
      ), f"state dict key are not the same, {model_characteristics['model_1']['state_dict'].keys()} vs {model_characteristics['model_2']['state_dict'].keys()}"
  
imports: import ctypes
  import os
  import random
  import socket
  import time
  import unittest
  from contextlib import closing
  from functools import wraps
  from typing import Any, Callable, Dict, Optional, TypeVar
  import numpy
  import torch
  import torch.distributed
  from pyre_extensions import ParameterSpecification
  from torch import nn
label_desc: Use image node_id 10 for calling a global function with example usage: assert_state_buffers_parameters_equal(model_1, model_2, check_named_buffers, check_named_parameters, check_state_dict) without return types