code: def test_predict_route_not_blocked_if_routes_open():
      with Blocks() as demo:
          input = Textbox()
          output = Textbox()
          button = Button()
          button.click(
              lambda x: f"Hello, {x}!",
              input,
              output,
              queue=True,
              api_name="not_blocked",
          )
      app, _, _ = demo.queue(api_open=True).launch(
          prevent_thread_lock=True, show_api=False
      )
      assert not demo.show_api
      client = TestClient(app)
  
      result = client.post(
          "/api/not_blocked",
          json={"data": ["freddy"], "session_hash": "foo"},
      )
      assert result.status_code == 200
      assert result.json()["data"] == ["Hello, freddy!"]
  
      demo.close()
      demo.queue(api_open=False).launch(
          prevent_thread_lock=True, show_api=False
      )
      assert not demo.show_api
  
imports: import functools
  import os
  import tempfile
  from contextlib import asynccontextmanager, closing
  from unittest import mock
  import gradio_client
  import numpy
  import pandas
  import pytest
  import starlette.routing
  from fastapi import FastAPI
  from fastapi.testclient import TestClient
  from gradio_client import media_data
  import gradio
  from gradio import Blocks, Button, Interface, Number, Textbox, close_all, routes, wasm_utils
  from gradio.route_utils import FnIndexInferError
label_desc: Use image node_id 4 for calling a global function with example usage: test_predict_route_not_blocked_if_routes_open() without return types