code: def get_llama_proxy():
      # NOTE: This double lock allows the currently streaming llama model to
      # check if any other requests are pending in the same thread and cancel
      # the stream if so.
      llama_outer_lock.acquire()
      release_outer_lock = True
      try:
          llama_inner_lock.acquire()
          try:
              llama_outer_lock.release()
              release_outer_lock = False
              yield _llama_proxy
          finally:
              llama_inner_lock.release()
      finally:
          if release_outer_lock:
              llama_outer_lock.release()
  
imports: from __future__ import annotations
  import os
  import json
  from threading import Lock
  from functools import partial
  from typing import Iterator, List, Optional, Union, Dict
  import llama_cpp
  import anyio
  from anyio.streams.memory import MemoryObjectSendStream
  from starlette.concurrency import run_in_threadpool, iterate_in_threadpool
  from fastapi import Depends, FastAPI, APIRouter, Request, HTTPException, status
  from fastapi.middleware import Middleware
  from fastapi.middleware.cors import CORSMiddleware
  from fastapi.security import HTTPBearer
  from sse_starlette.sse import EventSourceResponse
  from starlette_context.plugins import RequestIdPlugin
  from starlette_context.middleware import RawContextMiddleware
  from llama_cpp.server.model import LlamaProxy
  from llama_cpp.server.settings import ConfigFileSettings, Settings, ModelSettings, ServerSettings
  from llama_cpp.server.types import CreateCompletionRequest, CreateEmbeddingRequest, CreateChatCompletionRequest, ModelList
  from llama_cpp.server.errors import RouteErrorHandler
label_desc: Use image node_id 4 for calling a global function with example usage: get_llama_proxy() without return types