code: def test_quickstart_counter(serve_with_client):
      @serve.deployment
      class Counter:
          def __init__(self):
              self.count = 0
  
          def __call__(self, *args):
              self.count += 1
              return {"count": self.count}
  
      # Deploy our class.
      handle = serve.run(Counter.bind())
      print("deploy finished")
  
      # Query our endpoint in two different ways: from HTTP and from Python.
      assert requests.get("http://127.0.0.1:8000/Counter").json() == {
          "count": 1
      }
      print("query 1 finished")
      assert handle.remote().result() == {"count": 2}
      print("query 2 finished")
  
file_path: ray/python/ray/serve/tests/test_ray_client.py
imports: import random
  import subprocess
  import sys
  import time
  import pytest
  import requests
  import ray
  from ray import serve
  from ray._private.test_utils import run_string_as_driver
label_desc: Use image node_id 5 for calling a global function with example usage: test_quickstart_counter(serve_with_client) and returns: dict