code: def do_action(self, context, action):
      trace_middleware = context.get_middleware("trace")
      if trace_middleware:
          TraceContext.set_trace_id(trace_middleware.trace_id)
      if action.type == "get-trace-id":
          if self.delegate:
              for result in self.delegate.do_action(action):
                  yield result
          else:
              trace_id = TraceContext.current_trace_id().encode("utf-8")
              print("Returning trace ID:", trace_id)
              buf = pa.py_buffer(trace_id)
              yield pa.flight.Result(buf)
      else:
          raise KeyError(f"Unknown action {action.type!r}")
  
imports: import argparse
  import sys
  import threading
  import uuid
  import pyarrow
  import pyarrow.flight
label_desc: Use image node_id 3 for calling the FlightServer obj's underlying member method code with example usage: obj.do_action(context, action) without return types