def parse_denoiser_mapping(denoiser_map):
 result = {}
 for line in denoiser_map:
  line = line.strip().split(' DCTB ')
  denoised_id = line[0].rstrip(':')
  original_ids = ([denoised_id] + line[1:])
  if (denoised_id in result):
   raise ValueError('Duplicated identifiers in denoiser mapping file: are you sure you merged the correct files?')
  else:
   result[denoised_id] = original_ids
 return result

def parse_denoiser_mapping ( denoiser_map ) : result = { } for line in denoiser_map : line = line . strip ( ) . split ( ' DCTB ' ) denoised_id = line [ 0 ] . rstrip ( ':' ) original_ids = ( [ denoised_id ] + line [ 1 : ] ) if ( denoised_id in result ) : raise ValueError ( 'Duplicated identifiers in denoiser mapping file: are you sure you merged the correct files?' ) else : result [ denoised_id ] = original_ids return result
read a denoiser mapping file into a dictionary .