code: def addAnchorEmb(
      emb: torch.Tensor,
      anchor_sample_n: int,
      anchor_spk_n: int,
      sigma: float,
  ) -> torch.Tensor:
      """
      Add randomly generated synthetic embeddings to make eigenanalysis more stable.
      We refer to these embeddings as anchor embeddings.
  
      emb (Tensor):
          The input embedding from the embedding extractor.
      anchor_sample_n (int):
          Number of embedding samples per speaker.
          anchor_sample_n = 10 is recommended.
      anchor_spk_n (int):
          Number of speakers for synthetic embedding.
          anchor_spk_n = 3 is recommended.
      sigma (int):
          The amplitude of synthetic noise for each embedding vector.
          If the sigma value is too small, under-counting could happen.
          If the sigma value is too large, over-counting could happen.
          sigma = 50 is recommended.
      """
      emb_dim = emb.shape[1]
      std_org = torch.std(emb, dim=0)
      sigma = torch.tensor(sigma).to(emb.device)
      new_emb_list = []
      for _ in range(anchor_spk_n):
          emb_m = torch.tile(
              torch.randn(1, emb_dim), (anchor_sample_n, 1)
          ).to(emb.device)
          emb_noise = torch.randn(anchor_sample_n, emb_dim).T.to(
              emb.device
          )
          emb_noise = torch.matmul(
              torch.diag(std_org),
              emb_noise
              / torch.max(torch.abs(emb_noise), dim=0)[0].unsqueeze(0),
          ).T
          emb_gen = emb_m + sigma * emb_noise
          new_emb_list.append(emb_gen)
  
      new_emb_list.append(emb)
      new_emb_np = torch.vstack(new_emb_list)
      return new_emb_np
  
imports: from typing import Dict, List, Tuple
  import torch
  from torch.linalg import eigh, eigvalsh
label_desc: Use image node_id 20 for calling a global function with example usage: addAnchorEmb(emb, anchor_sample_n, anchor_spk_n, sigma) and returns: new_emb_np