def file_find(filename, preferred_path=None, raise_if_missing=True):
 search_paths = _get_search_paths(preferred_path, suffix=filename)
 for file_candidate in search_paths:
  if os.path.isfile(file_candidate):
   return file_candidate
 if raise_if_missing:
  raise MissingDataSource(search_paths)
 else:
  return False

def file_find ( filename , preferred_path = None , raise_if_missing = True ) : search_paths = _get_search_paths ( preferred_path , suffix = filename ) for file_candidate in search_paths : if os . path . isfile ( file_candidate ) : return file_candidate if raise_if_missing : raise MissingDataSource ( search_paths ) else : return False
return the path to an existing file .