code: def test_from_pretrained_internal(model, monkeypatch):
      hf_hub_download = Mock(side_effect="model")
      monkeypatch.setattr(
          "torch_geometric.nn.model_hub.hf_hub_download",
          hf_hub_download,
      )
      monkeypatch.setattr(
          "torch_geometric.nn.model_hub.torch.load",
          lambda x, **kwargs: {"state_dict": 1},
      )
  
      model = model._from_pretrained(
          model_id=MODEL_NAME,
          revision=None,
          cache_dir=None,
          force_download=False,
          proxies=None,
          resume_download=True,
          local_files_only=False,
          token=False,
          dataset_name=DATASET_NAME,
          model_name=MODEL_NAME,
          map_location="cpu",
          strict=False,
          **CONFIG,
      )
  
      assert hf_hub_download.call_count == 1
      assert model.model_config == CONFIG
  
file_path: pytorch_geometric/test/nn/test_model_hub.py
imports: import os
  from pathlib import Path
  from unittest.mock import Mock
  import pytest
  import torch
  from torch_geometric.nn import GCN
  from torch_geometric.nn.model_hub import PyGModelHubMixin
  from torch_geometric.testing import withPackage
label_desc: Use image node_id 7 for calling a global function with example usage: test_from_pretrained_internal(model, monkeypatch) without return types