code: def mock_requests_get(valid_url, return_value):
      """Used to replace `requests.get` with a function that returns the given value for the given valid URL and raises
      otherwise."""
  
      def inner(url):
          if url == valid_url:
              return _MockResponse(return_value)
          raise RuntimeError
  
      return inner
  
file_path: pytorch-lightning/tests/tests_app/plugin/test_plugin.py
imports: import io
  import json
  import sys
  import tarfile
  from dataclasses import dataclass
  from pathlib import Path
  from unittest import mock
  import pytest
  from fastapi import status
  from fastapi.testclient import TestClient
  from lightning.app.plugin.plugin import _Run, _start_plugin_server
  from lightning_cloud.openapi import Externalv1LightningappInstance
label_desc: Use image node_id 2 for calling a global function with example usage: mock_requests_get(valid_url, return_value) and returns: inner, _MockResponse