<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dump2json(self, obj, filepath, override=False, **kwargs):
 """ Dump a dictionary into a JSON dictionary. Uses the json.dump() function. Parameters obj : :class:`dict` A dictionary to be dumpped as JSON file. filepath : :class:`str` The filepath for the dumped file. override : :class:`bool` If True, any file in the filepath will be override. (default=False) """

        # We make sure that the object passed by the user is a dictionary.
        if isinstance(obj, dict):
            pass
        else:
            raise _NotADictionary(
                "This function only accepts dictionaries as input")
        # We check if the filepath has a json extenstion, if not we add it.
        if str(filepath[-4:]) == 'json':
            pass
        else:
            filepath = ".".join((str(filepath), "json"))
        # 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))
        # We dump the object to the json file. Additional kwargs can be passed.
        with open(filepath, 'w+') as json_file:
            json.dump(obj, json_file, **kwargs)