code: def list_train_dirs(dir_: str, recursive: bool, all_: bool, long: bool, verbose: bool) -> None:
      
      if verbose:
          long = True
  
      if dir_ == CXF_DEFAULT_LOG_DIR and not path.exists(CXF_DEFAULT_LOG_DIR):
          print('The default log directory `{}` does not exist.\n'
                'Consider specifying the directory to be listed as an argument.'.format(CXF_DEFAULT_LOG_DIR))
          quit(1)
  
      if not path.exists(dir_):
          print('Specified dir `{}` does not exist'.format(dir_))
          quit(1)
  
      all_trainings = _ls_print_listing(dir_, recursive, all_, long)
  
      if long and len(all_trainings) > 1:
          if not recursive:
              print()
          _ls_print_summary(all_trainings)
  
      if verbose and len(all_trainings) == 1:
          if not recursive:
              print()
          _ls_print_verbose(all_trainings[0])
docs: List training dirs contained in the given dir with options and outputs similar to the regular `ls` command.
      The function is accessible through cxflow CLI `cxflow ls`.
  
      :param dir_: dir to be listed
      :param recursive: walk recursively in sub-directories, stop at train dirs (--recursive option)
      :param all_: include train dirs with no epochs done (--all option)
      :param long: list more details including model name, odel and dataset class,
                   age, duration and epochs done (--long option)
      :param verbose: print more verbose output with list of additional artifacts and training config,
                      applicable only when a single train dir is listed (--verbose option)