<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __rename_path(self, source, target):
 """ Renames given source with given target name. :param source: Source file. :type source: unicode :param target: Target file. :type target: unicode """


        if not foundations.common.path_exists(source):
            return

        parent_directory = os.path.dirname(source)
        is_path_registered = self.__engine.file_system_events_manager.is_path_registered(parent_directory)
        is_path_registered and self.__engine.file_system_events_manager.unregister_path(parent_directory)
        os.rename(source, target)
        is_path_registered and self.__engine.file_system_events_manager.register_path(parent_directory)