<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_files(base_dir, extensions, exclude_dirs=list()):
 """ Find all files matching the given extensions. Args: base_dir (str):
 Path of base directory to search in. extensions (list):
 A list of file extensions to search for. exclude_dirs (list):
 A list of directories to exclude from search. Returns: list of paths that match the search """

    result = []
    for root, dir_names, file_names in os.walk(base_dir):
        for filename in file_names:
            candidate = os.path.join(root, filename)
            if should_include_file_in_search(candidate, extensions, exclude_dirs):
                result.append(candidate)
    return result