code: def partition_spans_by_kind(traces):
      """Returns three lists each containing spans of kind SpanKind.SERVER, SpanKind.CLIENT and SpandKind.INTERNAL"""
      server_spans = []
      client_spans = []
      internal_spans = []
  
      for trace in traces:
          for span in trace["spans"]:
              for tag in span["tags"]:
                  if "span.kind" == tag.get("key", ""):
                      span_kind = tag.get("value", "")
                      if "server" == span_kind:
                          server_spans.append(span)
                      elif "client" == span_kind:
                          client_spans.append(span)
                      elif "internal" == span_kind:
                          internal_spans.append(span)
  
      return (server_spans, client_spans, internal_spans)
  
imports: from typing import Dict, Optional
  import requests
  from docarray import DocumentArray
  from opentelemetry.context.context import Context
  from prometheus_api_client import PrometheusConnect
  from jina import Executor, requests
label_desc: Use image node_id 4 for calling a global function with example usage: partition_spans_by_kind(traces) and returns: server_spans,  client_spans,  internal_spans