def _get_command_string(self, cmd, args):
        """
        Escape the command arguments and form a command string.

        :type cmd: ``str``
        :type args: ``list``

        :rtype: ``str``
        """
        if not isinstance(args, (list, tuple)):
            raise TypeError(
                "The args has a value that is not a list or a tuple"
                f" (was {type(args)})."
            )

        args = [quote_unix(arg) for arg in args]
        args = " ".join(args)
        result = "%s %s" % (cmd, args)
        return result

        Escape the command arguments and form a command string.

        :type cmd: ``str``
        :type args: ``list``

        :rtype: ``str``
        
st2common/st2common/models/system/action.py