code: def mock_repo_info(fs: HfFileSystem):
      def _inner(
          repo_id: str, *, revision: str, repo_type: str, **kwargs
      ):
          if repo_id not in [
              "gpt2",
              "squad",
              "username/my_dataset",
              "username/my_model",
          ]:
              raise RepositoryNotFoundError(repo_id)
          if (
              revision is not None
              and revision not in ["main", "dev", "refs"]
              and not revision.startswith("refs/")
          ):
              raise RevisionNotFoundError(revision)
  
      return patch.object(fs._api, "repo_info", _inner)
  
imports: import datetime
  import unittest
  from typing import Optional
  from unittest.mock import patch
  import fsspec
  import pytest
  from huggingface_hub.hf_file_system import HfFileSystem
  from huggingface_hub.utils import RepositoryNotFoundError, RevisionNotFoundError
  from .testing_constants import ENDPOINT_STAGING, TOKEN
  from .testing_utils import repo_name
label_desc: Use image node_id 4 for calling a global function with example usage: mock_repo_info(fs) and returns: patch