code: def served_depl(request: FixtureRequest, exposed_port):
      import threading
      import time
  
      def serve_depl(stop_event, **kwargs):
          depl = Deployment(uses=MyServeExec, **kwargs)
          with depl:
              depl.block(stop_event)
  
      stop_event = threading.Event()
  
      kwargs = {"port": exposed_port}
      enable_dynamic_batching = request.param
      if enable_dynamic_batching:
          kwargs["uses_dynamic_batching"] = {
              "/bar": {"preferred_batch_size": 4, "timeout": 5000}
          }
  
      t = threading.Thread(
          name="serve-depl",
          target=serve_depl,
          args=(stop_event,),
          kwargs=kwargs,
      )
      t.start()
      time.sleep(3)  # allow Deployment to start
  
      yield
  
      stop_event.set()  # set event and stop (unblock) the Deployment
      t.join()
  
imports: import asyncio
  import json
  import time
  import pytest
  from docarray import Document, DocumentArray
  from pytest import FixtureRequest
  from jina import Client, Document, Executor, requests
  from jina.enums import PollingType
  from jina.helper import random_port
  from jina.orchestrate.deployments import Deployment
  from jina.parsers import set_deployment_parser, set_gateway_parser
label_desc: Use image node_id 7 for calling a global function with example usage: served_depl(request, exposed_port) without return types