code: def with_staging_testing(func):
      file_download = patch(
          "huggingface_hub.file_download.HUGGINGFACE_CO_URL_TEMPLATE",
          ENDPOINT_STAGING + "/{repo_id}/resolve/{revision}/{filename}",
      )
  
      hf_api = patch(
          "huggingface_hub.constants.ENDPOINT",
          ENDPOINT_STAGING,
      )
  
      repository = patch(
          "huggingface_hub.constants.ENDPOINT",
          ENDPOINT_STAGING,
      )
  
      return repository(hf_api(file_download(func)))
  
file_path: allennlp/tests/common/push_to_hub_test.py
imports: import shutil
  import time
  import pytest
  import requests
  from huggingface_hub import HfApi, Repository
  from unittest.mock import patch
  from allennlp.common.push_to_hf import push_to_hf
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.models import load_archive
label_desc: Use image node_id 1 for calling a global function with example usage: with_staging_testing(func) and returns: repository