docstr: Merge multiple spans into a synthetic one.
  The input spans must not be related with each other.
docstr_tok: ["Merge","multiple","spans","into","a","synthetic","one",".","The","input","spans","must","not","be","related","with","each","other","."]
code: def merge(*items: Span) -> Span:
      """Merge multiple spans into a synthetic one.
      The input spans must not be related with each other.
      """
      if not items:
          raise ValueError("Nothing to merge")
      out = Span(
          name=("(merged)",),
          id_="(merged)",
          parent=None,
          total_nthreads_history=items[0]._total_nthreads_history,
      )
      out._total_nthreads_offset = min(
          child._total_nthreads_offset for child in items
      )
      out.children.extend(items)
      out.enqueued = min(child.enqueued for child in items)
      return out
  
imports: from __future__ import annotations
  import uuid
  import weakref
  from collections import defaultdict
  from collections.abc import Hashable, Iterable, Iterator
  from contextlib import contextmanager
  from itertools import islice
  from typing import TYPE_CHECKING, Any
  import dask.config
  from dask.typing import Key
  from distributed.collections import sum_mappings
  from distributed.itertools import ffill
  from distributed.metrics import time
label_desc: Use image node_id 16 for calling the Span obj's underlying member method code with example usage: obj.merge() and returns: out