code: def masked_min(sample, mask=None):
      """A metric function that computes the minimum of each sample
  
      Arguments
      ---------
      samples: torch.Tensor
          a tensor of spectrograms
  
      mask: torch.Tensor
          a length mask
  
      Returns
      -------
      result: torch.Tensor
          a tensor fo means
      """
      if mask is None:
          mask = torch.ones_like(sample).bool()
      dims = non_batch_dims(sample)
      return sample.masked_fill(~mask.bool(), torch.inf).amin(dim=dims)
  
imports: import math
  import os
  import re
  import csv
  import shutil
  import urllib.request
  import collections.abc
  import torch
  import tqdm
  import pathlib
  import speechbrain
  from numbers import Number
label_desc: Use image node_id 31 for calling a global function with example usage: masked_min(sample, mask) and returns: sample