def collect_roots(base_paths, file_sig='*.plug'):
 result = set()
 for path_or_list in base_paths:
  if isinstance(path_or_list, (list, tuple)):
   result |= collect_roots(base_paths=path_or_list, file_sig=file_sig)
  elif (path_or_list is not None):
   result |= find_roots(path_or_list, file_sig)
 return result

def collect_roots ( base_paths , file_sig = '*.plug' ) : result = set ( ) for path_or_list in base_paths : if isinstance ( path_or_list , ( list , tuple ) ) : result |= collect_roots ( base_paths = path_or_list , file_sig = file_sig ) elif ( path_or_list is not None ) : result |= find_roots ( path_or_list , file_sig ) return result
collects all the paths from base_paths recursively that contains files of type file_sig .