<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _set_matplotlib_default_backend():
 """ matplotlib will try to print to a display if it is available, but don't want to run it in interactive mode. we tried setting the backend to 'Agg'' before importing, but it was still resulting in issues. we replace the existing backend with 'agg' in the default matplotlibrc. This is a hack until we can find a better solution """

    if _matplotlib_installed():
        import matplotlib
        matplotlib.use('Agg', force=True)
        config = matplotlib.matplotlib_fname()
        if os.access(config, os.W_OK):
            with file_transaction(config) as tx_out_file:
                with open(config) as in_file, open(tx_out_file, "w") as out_file:
                    for line in in_file:
                        if line.split(":")[0].strip() == "backend":
                            out_file.write("backend: agg\n")
                        else:
                            out_file.write(line)