docstr: Tests individual function list import by comparing the functions
  and their hashes.
docstr_tok: ["Tests","individual","function","list","import","by","comparing","the","functions","and","their","hashes","."]
code: def _test_function_import(
      self,
      package_name: str,
      function_list: List[str],
      base: Optional[str] = None,
      new_package_name: Optional[str] = None,
  ):
      r"""Tests individual function list import by comparing the functions
      and their hashes."""
      if base is None:
          base = "quantization"
      old_base = "torch." + base
      new_base = "torch.ao." + base
      if new_package_name is None:
          new_package_name = package_name
      old_location = importlib.import_module(
          f"{old_base}.{package_name}"
      )
      new_location = importlib.import_module(
          f"{new_base}.{new_package_name}"
      )
      for fn_name in function_list:
          old_function = getattr(old_location, fn_name)
          new_function = getattr(new_location, fn_name)
          assert (
              old_function == new_function
          ), f"Functions don't match: {fn_name}"
          assert hash(old_function) == hash(new_function), (
              f"Hashes don't match: {old_function}({hash(old_function)}) vs. "
              f"{new_function}({hash(new_function)})"
          )
  
imports: from torch.testing._internal.common_utils import TestCase
  import importlib
  from typing import List, Optional
label_desc: Use image node_id 1 for calling the AOMigrationTestCase obj's underlying member method code with example usage: obj._test_function_import(package_name, function_list, base, new_package_name) without return types