def __parse_cmd_args(args, sudo, shell):
    if isinstance(args, tuple) and len(args) == 1 and isinstance(args[0], tuple):
        args = args[0]
    if shell:
        if isinstance(args, six.string_types):
            pass
        elif  isinstance(args, (list, tuple)) and len(args) > 1:
            args = ' '.join(args)
        elif isinstance(args, (list, tuple)) and len(args) == 1:
            if isinstance(args[0], (tuple, list)):
                args = ' '.join(args)
            elif isinstance(args[0], six.string_types):
                args = args[0]
    else:
        if isinstance(args, six.string_types):
            args = shlex.split(args, posix=not WIN32)
        elif isinstance(args, (list, tuple)):
            if len(args) > 1:
                args = tuple(args)
            elif len(args) == 1:
                if isinstance(args[0], (tuple, list)):
                    args = tuple(args[0])
                elif isinstance(args[0], six.string_types):
                    args = shlex.split(args[0], posix=not WIN32)
    if sudo is True:
        if not WIN32:
            if shell:
                args = 'sudo ' + args
            else:
                args = tuple(['sudo']) + tuple(args)
        else:
            pass
    if WIN32:
        if len(args) == 1 and isinstance(args[0], six.string_types):
            args = shlex.split(args[0], posix=not WIN32)
    return args