def dump2file(self, obj, filepath, override=False, **kwargs):
        """
        Dump a dictionary into a file. (Extensions: XYZ or PDB)

        Parameters
        ----------
        obj : :class:`dict`
            A dictionary containing molecular information.

        filepath : :class:`str`
           The filepath for the dumped file.

        override : :class:`bool`
           If True, any file in the filepath will be override. (default=False)
        """
        # First we check if the file already exists. If yes and the override
        # keyword is False (default), we will raise an exception. Otherwise
        # the file will be overwritten.
        if override is False:
            if os.path.isfile(filepath):
                raise _FileAlreadyExists(
                    "The file {0} already exists. Use a different filepath, "
                    "or set the 'override' kwarg to True.".format(filepath))
        if str(filepath[-3:]) not in self._save_funcs.keys():
            raise _FileTypeError(
                "The {0} file extension is "
                "not supported for dumping a MolecularSystem or a Molecule. "
                "Please use XYZ or PDB.".format(str(filepath[-3:])))
        self._save_funcs[str(filepath[-3:])](obj, filepath, **kwargs)
Dump a dictionary into a file. (Extensions: XYZ or PDB)

        Parameters
        ----------
        obj : :class:`dict`
            A dictionary containing molecular information.

        filepath : :class:`str`
           The filepath for the dumped file.

        override : :class:`bool`
           If True, any file in the filepath will be override. (default=False)