def remove_result_ranges_diffs(result_list, file_dict):
 result_diff_dict_dict = {}
 for original_result in result_list:
  mod_file_dict = copy.deepcopy(file_dict)
  source_ranges = []
  previous = None
  for source_range in sorted(original_result.affected_code, reverse=True):
   if ((previous is not None) and source_range.overlaps(previous)):
    combined_sr = SourceRange.join(previous, source_range)
    previous = combined_sr
   elif (previous is None):
    previous = source_range
   else:
    source_ranges.append(previous)
    previous = source_range
  if previous:
   source_ranges.append(previous)
  for source_range in source_ranges:
   file_name = source_range.file
   new_file = remove_range(mod_file_dict[file_name], source_range)
   mod_file_dict[file_name] = new_file
  diff_dict = {}
  for file_name in file_dict:
   diff_dict[file_name] = Diff.from_string_arrays(file_dict[file_name], mod_file_dict[file_name])
  result_diff_dict_dict[original_result] = diff_dict
 return result_diff_dict_dict

def remove_result_ranges_diffs ( result_list , file_dict ) : result_diff_dict_dict = { } for original_result in result_list : mod_file_dict = copy . deepcopy ( file_dict ) source_ranges = [ ] previous = None for source_range in sorted ( original_result . affected_code , reverse = True ) : if ( ( previous is not None ) and source_range . overlaps ( previous ) ) : combined_sr = SourceRange . join ( previous , source_range ) previous = combined_sr elif ( previous is None ) : previous = source_range else : source_ranges . append ( previous ) previous = source_range if previous : source_ranges . append ( previous ) for source_range in source_ranges : file_name = source_range . file new_file = remove_range ( mod_file_dict [ file_name ] , source_range ) mod_file_dict [ file_name ] = new_file diff_dict = { } for file_name in file_dict : diff_dict [ file_name ] = Diff . from_string_arrays ( file_dict [ file_name ] , mod_file_dict [ file_name ] ) result_diff_dict_dict [ original_result ] = diff_dict return result_diff_dict_dict
calculates the diffs to all files in file_dict that describe the removal of each respective results affected code .