def auto_find_exps(all_exp_pattern: str,
                   re_pattern: str = '(.+)$') -> Tuple[List[str], List[str]]:
  """Finds all validate experiment names and their directories.

  Args:
    all_exp_pattern: Pattern to find all the experiments.
    re_pattern: Regular expression of the experiment dir to find. Use '()' to
      capture the  experiment ID. E.g.
      all_exp_pattern = '/path/to/exp_name/43951735/*'
      re_pattern = '.*/(10.*)$'
      It will find all the wid under 43951735 starting with 10 such as
      10, 100, 101, ... and use the (10.*) as the experiment name.

  Returns:
    exp_names: 1D list of experiment names.
    exp_dirs: 1D list of experiment absolute paths.
  """
  files = gfile.glob(all_exp_pattern)
  files.sort()
  exp_names, exp_dirs = [], []
  for f in files:
    cur_match = re.match(re_pattern, f)
    if cur_match:
      exp_names.append(cur_match.group(1))
      exp_dirs.append(os.path.join(cur_match.group(0), 'events*'))

  exp_names, exp_dirs = zip(*sorted(zip(exp_names, exp_dirs)))
  for i in range(len(exp_dirs)):
    assert exp_names[i] in exp_dirs[
        i], f'Unmatched {exp_names[i]} and {exp_dirs[i]}'
  return exp_names, exp_dirs
Finds all validate experiment names and their directories.

  Args:
    all_exp_pattern: Pattern to find all the experiments.
    re_pattern: Regular expression of the experiment dir to find. Use '()' to
      capture the  experiment ID. E.g.
      all_exp_pattern = '/path/to/exp_name/43951735/*'
      re_pattern = '.*/(10.*)$'
      It will find all the wid under 43951735 starting with 10 such as
      10, 100, 101, ... and use the (10.*) as the experiment name.

  Returns:
    exp_names: 1D list of experiment names.
    exp_dirs: 1D list of experiment absolute paths.
  
videogvt/interfaces/colab_utils.py