def get_ns_commands(self, cmd_name):
        """
        Retrieves the possible name spaces and commands associated to the given
        command name.

        :param cmd_name: The given command name
        :return: A list of 2-tuples (name space, command)
        :raise ValueError: Unknown command name
        """
        namespace, command = _split_ns_command(cmd_name)
        if not namespace:
            # Name space not given, look for the commands
            spaces = self.__find_command_ns(command)
            if not spaces:
                # Unknown command
                raise ValueError("Unknown command {0}".format(command))
            else:
                # Return a sorted list of tuples
                return sorted((namespace, command) for namespace in spaces)

        # Single match
        return [(namespace, command)]
def get_ns_commands ( self , cmd_name ) : namespace , command = _split_ns_command ( cmd_name ) if not namespace : spaces = self . __find_command_ns ( command ) if not spaces : raise ValueError ( "Unknown command {0}" . format ( command ) ) else : return sorted ( ( namespace , command ) for namespace in spaces ) return [ ( namespace , command ) ]
Retrieves the possible name spaces and commands associated to the given
        command name.

        :param cmd_name: The given command name
        :return: A list of 2-tuples (name space, command)
        :raise ValueError: Unknown command name