code: def all_gather_embeddings_and_labels(emb, labels):
      # If we are not using distributed training, this is a no-op.
      if not is_distributed():
          return None, None
      ref_emb = all_gather(emb)
      ref_labels = all_gather(labels) if labels is not None else None
      return ref_emb, ref_labels
  
imports: import torch
  from ..losses import BaseMetricLossFunction, CrossBatchMemory
  from ..miners import BaseMiner
  from ..utils import common_functions
  from ..utils import loss_and_miner_utils
label_desc: Use image node_id 3 for calling a global function with example usage: all_gather_embeddings_and_labels(emb, labels) and returns: ref_emb,  ref_labels, None,  None