def rc_params(fail_on_error=False):
fname = matplotlib_fname()<EOL>if not os.path.exists(fname):<EOL><INDENT>message = '<STR_LIT>'<EOL>ret = RcParams([ (key, default) for key, (default, converter) indefaultParams.items() ])<EOL>warnings.warn(message)<EOL>return ret<EOL><DEDENT>cnt = <NUM_LIT:0><EOL>rc_temp = {}<EOL>for line in file(fname):<EOL><INDENT>cnt += <NUM_LIT:1><EOL>strippedline = line.split('<STR_LIT:#>',<NUM_LIT:1>)[<NUM_LIT:0>].strip()<EOL>if not strippedline: continue<EOL>tup = strippedline.split('<STR_LIT::>',<NUM_LIT:1>)<EOL>if len(tup) !=<NUM_LIT:2>:<EOL><INDENT>warnings.warn('<STR_LIT>'%(cnt, line, fname))<EOL>continue<EOL><DEDENT>key, val = tup<EOL>key = key.strip()<EOL>val = val.strip()<EOL>if key in rc_temp:<EOL><INDENT>warnings.warn('<STR_LIT>'%(fname,cnt))<EOL><DEDENT>rc_temp[key] = (val, line, cnt)<EOL><DEDENT>ret = RcParams([ (key, default) for key, (default, converter) indefaultParams.items() ])<EOL>for key in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if key in rc_temp:<EOL><INDENT>val, line, cnt = rc_temp.pop(key)<EOL>if fail_on_error:<EOL><INDENT>ret[key] = val <EOL><DEDENT>else:<EOL><INDENT>try: ret[key] = val <EOL>except Exception as msg:<EOL><INDENT>warnings.warn('<STR_LIT>' % (val, cnt, line, fname, msg))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>verbose.set_level(ret['<STR_LIT>'])<EOL>verbose.set_fileo(ret['<STR_LIT>'])<EOL>for key, (val, line, cnt) in rc_temp.items():<EOL><INDENT>if key in defaultParams:<EOL><INDENT>if fail_on_error:<EOL><INDENT>ret[key] = val <EOL><DEDENT>else:<EOL><INDENT>try: ret[key] = val <EOL>except Exception as msg:<EOL><INDENT>warnings.warn('<STR_LIT>' % (val, cnt, line, fname, msg))<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>print("""<STR_LIT>""" % (key, cnt, fname), file=sys.stderr)<EOL><DEDENT><DEDENT>if ret['<STR_LIT>'] is None:<EOL><INDENT>ret['<STR_LIT>'] = get_data_path()<EOL><DEDENT>if not ret['<STR_LIT>'] == ['<STR_LIT>']:<EOL><INDENT>verbose.report(
Return the default params updated from the values in the rc file