code: def __rebalance_files(
      max_count: int, label_filepath: str
  ) -> Tuple[str, List[str], int]:
      """
      Rebalance the number of samples for a class.
  
      Args:
          max_count: maximum number of samples for a class
          label_filepath: list of filepaths for a class
  
      Returns:
          Rebalanced list of filepaths along with the label name and the number of samples
      """
      command, samples = label_filepath
      filepaths = [sample[1] for sample in samples]
  
      rng = np.random.RandomState(0)
      filepaths = np.asarray(filepaths)
      num_samples = len(filepaths)
  
      if num_samples < max_count:
          difference = max_count - num_samples
          duplication_ids = rng.choice(
              num_samples, difference, replace=True
          )
          filepaths = np.append(
              filepaths, filepaths[duplication_ids], axis=0
          )
  
      return command, filepaths, num_samples
  
imports: import argparse
  import glob
  import json
  import logging
  import os
  import re
  import tarfile
  import urllib.request
  from collections import defaultdict
  from functools import partial
  from multiprocessing import Pool
  from typing import Dict, List, Set, Tuple
  import librosa
  import numpy
  import soundfile
  from tqdm import tqdm
label_desc: Use image node_id 7 for calling a global function with example usage: __rebalance_files(max_count, label_filepath) and returns: command,  filepaths,  num_samples