<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_import_root_map_file(path, import_root_map):
 """Writes a file mapping import paths to roots."""

    with safe_concurrent_creation(path) as safe_path:
      with open(safe_path, 'w') as fp:
        for import_path, root in sorted(import_root_map.items()):
          fp.write('{}\t{}\n'.format(import_path, root))