code: def response_factory(status_code, json_data=None):
      response = requests.Response()
      if json_data is not None:
          response._content = json.dumps(json_data).encode()
      response.status_code = status_code
      return response
  
file_path: wandb/tests/pytest_tests/unit_tests/test_normalize.py
imports: import json
  import pytest
  import requests
  from wandb.apis.normalize import normalize_exceptions
  from wandb.errors import CommError, Error
label_desc: Use image node_id 2 for calling a global function with example usage: response_factory(status_code, json_data) and returns: response