code: def search_candidate_paths(candidate_path_list, candidate_name_list=None,
                             priority_paths=None, required_subpaths=[],
                             verbose=None):
      import utool as ut
      if verbose is None:
          verbose = 0 if QUIET else 1
      if verbose >= 1:
          print('[search_candidate_paths] Searching for candidate paths')
      if candidate_name_list is not None:
          candidate_path_list_ = [join(dpath, fname) for dpath, fname in
                                  itertools.product(candidate_path_list,
                                                    candidate_name_list)]
      else:
          candidate_path_list_ = candidate_path_list
      if priority_paths is not None:
          candidate_path_list_ = priority_paths + candidate_path_list_
      return_path = None
      for path in candidate_path_list_:
          if path is not None and exists(path):
              if verbose >= 2:
                  print('[search_candidate_paths] Found candidate directory %r' % (path,))
                  print('[search_candidate_paths] ... checking for approprate structure')
              subpath_list = [join(path, subpath) for subpath in required_subpaths]
              if all(ut.checkpath(path_, verbose=verbose) for path_ in subpath_list):
                  return_path = path
                  if verbose >= 2:
                      print('[search_candidate_paths] Found acceptable path')
                  return return_path
                  break
      if verbose >= 1:
          print('[search_candidate_paths] Failed to find acceptable path')
      return return_path