<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _set_commands(package_names):
 """ Extract the command name from package name. Last part of the module path is the command ie. if path is foo.bar.baz, then "baz" is the command name. :param package_names: List of package names :return: Dictionary with command name as key and the package name as value. """


        commands = {}

        for pkg_name in package_names:
            cmd_name = pkg_name.split('.')[-1]
            commands[cmd_name] = pkg_name

        return commands