code: def dnsmos_eval_valid(predict, target):
      """Note target is not used in the dnsmos function !!!
      Show the unnormalized score for valid and test set.
      """
      pred_wav = predict
  
      pred_wav = pred_wav.numpy()
      pred_wav = pred_wav / max(abs(pred_wav))
      data = {"data": pred_wav.tolist()}
      input_data = json.dumps(data)
      while True:
          try:
              u = urlparse(SCORING_URI)
              resp = requests.post(
                  urljoin("https://" + u.netloc, "score"),
                  data=input_data,
                  headers=headers,
              )
              score_dict = resp.json()
              score = float(score_dict["mos"])
              break
          except (
              Exception
          ) as e:  # sometimes, access the dnsmos server too ofen may disable the service.
              print(e)
              time.sleep(10)  # wait for 10 secs
      return score
  
imports: import os
  import sys
  import shutil
  import torch
  import torchaudio
  import speechbrain
  import numpy
  import json
  import pickle
  import requests
  import time
  from urllib.parse import urlparse, urljoin
  from srmrpy import srmr
  from pesq import pesq
  from enum import Enum, auto
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.metric_stats import MetricStats
  from speechbrain.processing.features import spectral_magnitude
  from speechbrain.nnet.loss.stoi_loss import stoi_loss
  from speechbrain.utils.distributed import run_on_main
  from speechbrain.dataio.sampler import ReproducibleWeightedRandomSampler
label_desc: Use image node_id 6 for calling a global function with example usage: dnsmos_eval_valid(predict, target) and returns: score