code: def test_checkpoint_sharding_local_from_pt(self):
      with tempfile.TemporaryDirectory() as tmp_dir:
          _ = Repository(
              local_dir=tmp_dir,
              clone_from="hf-internal-testing/tiny-random-bert-sharded",
          )
          model = TFBertModel.from_pretrained(tmp_dir, from_pt=True)
          # the model above is the same as the model below, just a sharded pytorch version.
          ref_model = TFBertModel.from_pretrained(
              "hf-internal-testing/tiny-random-bert"
          )
          for p1, p2 in zip(model.weights, ref_model.weights):
              assert np.allclose(p1.numpy(), p2.numpy())
  
imports: from __future__ import annotations
  import inspect
  import json
  import os
  import random
  import tempfile
  import unittest
  import unittest.mock
  from huggingface_hub import HfFolder, Repository, delete_repo, snapshot_download
  from huggingface_hub.file_download import http_get
  from requests.exceptions import HTTPError
  from transformers import is_tf_available, is_torch_available
  from transformers.configuration_utils import PretrainedConfig
  from transformers.testing_utils import TOKEN, USER, CaptureLogger, _tf_gpu_memory_limit, is_pt_tf_cross_test, is_staging_test, require_safetensors, require_tf, require_torch, slow
  from transformers.utils import SAFE_WEIGHTS_NAME, TF2_WEIGHTS_INDEX_NAME, TF2_WEIGHTS_NAME, logging
label_desc: Use image node_id 9 for calling the TFModelUtilsTest obj's underlying member method code with example usage: obj.test_checkpoint_sharding_local_from_pt() without return types