<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_file(self, filename, *, overwrite=False):
 """Write new ChemKED YAML file based on object. Arguments: filename (`str`):
 Filename for target YAML file overwrite (`bool`, optional):
 Whether to overwrite file with given name if present. Must be supplied as a keyword-argument. Raises: `NameError`: If ``filename`` is already present, and ``overwrite`` is not ``True``. Example: """

        # Ensure file isn't already present
        if exists(filename) and not overwrite:
            raise OSError(filename + ' already present. Specify "overwrite=True" '
                          'to overwrite, or rename.'
                          )

        with open(filename, 'w') as yaml_file:
            yaml.dump(self._properties, yaml_file)