<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_info(dirs, parallel, config):
 """Write cluster or local filesystem resources, spinning up cluster if not present. """

    if parallel["type"] in ["ipython"] and not parallel.get("run_local"):
        out_file = _get_cache_file(dirs, parallel)
        if not utils.file_exists(out_file):
            sys_config = copy.deepcopy(config)
            minfos = _get_machine_info(parallel, sys_config, dirs, config)
            with open(out_file, "w") as out_handle:
                yaml.safe_dump(minfos, out_handle, default_flow_style=False, allow_unicode=False)