code: def _match_stable_samples(
      samples_per_xp: tp.List[tp.Set[Sample]],
  ) -> tp.Dict[str, tp.List[Sample]]:
      # Create a dictionary of stable id -> sample per XP
      stable_samples_per_xp = [
          {
              sample.id: sample
              for sample in samples
              if sample.prompt is not None or sample.conditioning
          }
          for samples in samples_per_xp
      ]
      # Set of all stable ids
      stable_ids = {
          id
          for samples in stable_samples_per_xp
          for id in samples.keys()
      }
      # Dictionary of stable id -> list of samples. If an XP does not have it, assign None
      stable_samples = {
          id: [xp.get(id) for xp in stable_samples_per_xp]
          for id in stable_ids
      }
      # Filter out ids that contain None values (we only want matched samples after all)
      # cast is necessary to avoid mypy linter errors.
      return {
          id: tp.cast(tp.List[Sample], samples)
          for id, samples in stable_samples.items()
          if None not in samples
      }
  
imports: from concurrent.futures import ThreadPoolExecutor
  from dataclasses import asdict, dataclass
  from functools import lru_cache
  import hashlib
  import json
  import logging
  from pathlib import Path
  import re
  import typing
  import unicodedata
  import uuid
  import dora
  import torch
  from ...data.audio import audio_read, audio_write
label_desc: Use image node_id 2 for calling a global function with example usage: _match_stable_samples(samples_per_xp) and returns: unknown