code: def _find_extra_valid_paths(dataset_path: str) -> set:
      paths = utils.split_paths(dataset_path)
      all_valid_paths = set()
      for sub_dir in paths:
          contents = PathManager.ls(sub_dir)
          valid_paths = [
              c
              for c in contents
              if re.match("valid*[0-9].*", c) is not None
          ]
          all_valid_paths |= {os.path.basename(p) for p in valid_paths}
      # Remove .bin, .idx etc
      roots = {os.path.splitext(p)[0] for p in all_valid_paths}
      return roots
  
imports: import contextlib
  import itertools
  import logging
  import re
  import warnings
  from typing import Optional, Tuple
  import math
  import numpy
  import torch
  from fairseq.file_io import PathManager
  from fairseq import utils
  import os
label_desc: Use image node_id 19 for calling a global function with example usage: _find_extra_valid_paths(dataset_path) and returns: roots