def generate_change_ul(use_async: bool) ->str:
    """Generate the special 'change-ul' command.

    Args:
        use_async (bool): True if asynchronous code should be generated, false otherwise.

    Returns:
        str: A string containing the Python code for the 'change-ul' command.

    """
    result = ''
    result += (
        '    {_async}def change_ul(self, ul: UserLevel, passwd: str) -> int:\n'
        .format(_async='async ' if use_async else ''))
    result += """        assert isinstance(ul, UserLevel), "expected type 'UserLevel' for parameter 'ul', got '{}'".format(type(ul))
"""
    result += """        assert isinstance(passwd, str), "expected type 'str' for parameter 'passwd', got '{}'".format(type(passwd))
"""
    result += ('        return {_await}self.__client.change_ul(ul, passwd)'
        .format(_await='await ' if use_async else ''))
    return result
