<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extract_string_pairs_in_directory(directory_path, extract_func, filter_func):
 """ Retrieves all string pairs in the directory Args: directory_path (str):
 The path of the directory containing the file to extract string pairs from. extract_func (function):
 Function for extracting the localization keys and comments from the files. The extract function receives 2 parameters: - dict that the keys (a key in the dict) and comments (a value in the dict) are added to. - str representing file path filter_func (function):
 Function for filtering files in the directory. The filter function receives the file name and returns a bool representing the filter result. True if the file name passed the filter, False otherwise. Returns: dict: A mapping between string pairs first value (probably the key), and the second value (probably the comment). """

    result = {}
    for root, dirnames, filenames in os.walk(directory_path):
        for file_name in filenames:
            if filter_func(file_name):
                file_path = os.path.join(root, file_name)
                try:
                    extract_func(result, file_path)
                except Exception as e:
                    print "Error in file " + file_name
                    print e
    return result