code: def add_metadata_to_request(fun):
      @wraps(fun)
      async def wrapped(request, *args, **kwargs):
          request["batch_telemetry"] = {"operation": fun.__name__}
  
          batch_id = request.match_info.get("batch_id")
          if batch_id is not None:
              request["batch_telemetry"]["batch_id"] = batch_id
  
          job_id = request.match_info.get("job_id")
          if job_id is not None:
              request["batch_telemetry"]["job_id"] = job_id
  
          return await fun(request, *args, **kwargs)
  
      return wrapped
  
imports: import json
  import logging
  from collections import deque
  from functools import wraps
  from typing import Any, Deque, Dict, List, Optional, Set, Tuple, overload
  from aiohttp import web
  from gear import Database, maybe_parse_bearer_header
  from hailtop.utils import secret_alnum_string
label_desc: Use image node_id 2 for calling a global function with example usage: add_metadata_to_request(fun) and returns: wrapped, unknown