def replace_opts(rep_doc, opts):
 for (key, val) in list(opts.items()):
  rep_doc = rep_doc.replace(key, val)
 return rep_doc

def replace_opts ( rep_doc , opts ) : for ( key , val ) in list ( opts . items ( ) ) : rep_doc = rep_doc . replace ( key , val ) return rep_doc
replace flags with parameter names .