code: def require_torch(test_case):
      """
      Decorator marking a test that requires PyTorch.
      These tests are skipped when PyTorch isn't installed.
      """
      if not is_torch_available():
          return unittest.skip("test requires PyTorch")(test_case)
      else:
          return test_case
  
imports: import json
  import os
  import unittest
  from pathlib import Path
  from typing import TypeVar
  from unittest.mock import Mock, patch
  import pytest
  from huggingface_hub import HfApi, hf_hub_download
  from huggingface_hub.hub_mixin import PyTorchModelHubMixin
  from huggingface_hub.utils import SoftTemporaryDirectory, is_torch_available
  from .testing_constants import ENDPOINT_STAGING, TOKEN, USER
  from .testing_utils import repo_name
label_desc: Use image node_id 1 for calling a global function with example usage: require_torch(test_case) and returns: unittest, test_case