def compare_dicts(file, src_test_dict, infer_dict):
    """
    Check if a particular file
        exists in the source/test dict and infer dict
    If file exists, decrement the counter in
        both dictionaries
    Args:
        file: file potentially not analyzed by infer
        src_test_dict: dictionary containing
                       src/test files
        infer_dict: dictionary containing infer files
    Returns:
        True if file exists in both, False otherwise
    """
    if file in src_test_dict and file in infer_dict:
        if src_test_dict[file] > 0 and infer_dict[file] > 0:
            src_test_dict[file] -= 1
            infer_dict[file] -= 1
            return True
    return False