code: def query_or_cookie_extractor(
      q: str = Depends(query_extractor),
      last_query: str | None = Cookie(default=None),
  ):
      if not q:
          return last_query
      return q
  
label_desc: Use image node_id 2 for calling a global function with example usage: query_or_cookie_extractor(q, last_query) and returns: q, last_query