code: def subsample_pair_dataset(dataset, num_samples, seed_num=-1):
      if len(dataset) <= num_samples:
          return
      if seed_num != -1:
          np.random.seed(seed_num)
      indices = np.random.permutation(len(dataset))[:num_samples]
      dataset.src.subsample(indices)
      dataset.src_sizes = dataset.src.sizes
      dataset.tgt.subsample(indices)
      dataset.tgt_sizes = dataset.tgt.sizes
  
imports: import os
  import shutil
  import tempfile
  from typing import Dict, NamedTuple, Optional
  import numpy
  import torch
  from fairseq import data, tokenizer
  from fvcore.common.file_io import PathManager
  from pytorch_translate import constants
  from pytorch_translate.data import dictionary
label_desc: Use image node_id 4 for calling a global function with example usage: subsample_pair_dataset(dataset, num_samples, seed_num) without return types