code: def _write_import_root_map_file(path, import_root_map):
      
      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))
docs: Writes a file mapping import paths to roots.