code: def dump_feature(
      reader,
      in_filetype,
      rspecifier,
      out_filetype,
      wspecifier,
      write_num_frames=None,
  ):
      with file_writer_helper(
          wspecifier,
          filetype=out_filetype,
          write_num_frames=write_num_frames,
      ) as writer:
          for utt, mat in file_reader_helper(rspecifier, in_filetype):
              if is_scipy_wav_style(mat):
                  # If data is sound file, then got as Tuple[int, ndarray]
                  rate, mat = mat
                  mat = mat.astype(np.float64, order="C") / 32768.0
              nsample = len(mat)
              feat = (
                  reader.get_feats(mat, nsample).detach().cpu().numpy()
              )
              writer[utt] = feat
      logger.info("finished successfully")
  
file_path: espnet/egs2/librispeech/asr2/local/dump_hubert_or_wavlm_feature.py
imports: import argparse
  import logging
  import os
  import numpy
  from hubert_feature_loader import HubertFeatureReader
  from wavlm_feature_loader import WavLMFeatureReader
  from espnet.utils.cli_readers import file_reader_helper
  from espnet.utils.cli_utils import is_scipy_wav_style
  from espnet.utils.cli_writers import file_writer_helper
label_desc: Use image node_id 2 for calling a global function with example usage: dump_feature(reader, in_filetype, rspecifier, out_filetype, wspecifier, write_num_frames) without return types