def coalesce_options(options, types):
 out = {}
 for (key, value) in options.items():
  if (key in types):
   out[key] = coalesce_option_value(value, types[key], key)
  else:
   out[key] = value
 return out

def coalesce_options ( options , types ) : out = { } for ( key , value ) in options . items ( ) : if ( key in types ) : out [ key ] = coalesce_option_value ( value , types [ key ] , key ) else : out [ key ] = value return out
coalesce options dictionary according to types dictionary .