code: def dev_tuner(full_meta, split_type):
      """Tuning n_components on dev set. Used for nn based affinity matrix.
      Note: This is a very basic tunning for nn based affinity.
      This is work in progress till we find a better way.
      """
  
      DER_list = []
      pval = None
      for n_lambdas in range(1, params["max_num_spkrs"] + 1):
          # Process whole dataset for value of n_lambdas.
          concate_rttm_file = diarize_dataset(
              full_meta, split_type, n_lambdas, pval
          )
  
          ref_rttm = os.path.join(
              params["ref_rttm_dir"], "fullref_ami_dev.rttm"
          )
          sys_rttm = concate_rttm_file
          [MS, FA, SER, DER_] = DER(
              ref_rttm,
              sys_rttm,
              params["ignore_overlap"],
              params["forgiveness_collar"],
          )
  
          DER_list.append(DER_)
  
      # Take n_lambdas with minmum DER.
      tuned_n_lambdas = DER_list.index(min(DER_list)) + 1
  
      return tuned_n_lambdas
  
imports: import os
  import sys
  import torch
  import logging
  import pickle
  import json
  import glob
  import shutil
  import numpy
  import speechbrain
  from tqdm.contrib import tqdm
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.distributed import run_on_main
  from speechbrain.processing.PLDA_LDA import StatObject_SB
  from speechbrain.processing import diarization
  from speechbrain.utils.DER import DER
  from speechbrain.dataio.dataio import read_audio
  from speechbrain.dataio.dataio import read_audio_multichannel
label_desc: Use image node_id 8 for calling a global function with example usage: dev_tuner(full_meta, split_type) and returns: tuned_n_lambdas