<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def ban_user(channel, user):
 """ Bans a user from a server Args: channel: The channel to send the warning message in user: The user to give the warning to """


    data = datatools.get_data()
    server_id = channel.server.id

    try:
        await client.ban(user)
    except discord.errors.Forbidden:
        await client.send_typing(channel)
        embed = ui_embed.error(channel, "Ban Error", "I do not have the permissions to ban that person.")
        await embed.send()
        return

    # Set the user's warnings to 0
    if "warnings" in data["discord"]["servers"][server_id][_data.modulename]:
        if user.id in data["discord"]["servers"][server_id][_data.modulename]["warnings"]:
            data["discord"]["servers"][server_id][_data.modulename]["warnings"][user.id] = 0
            datatools.write_data(data)

    await client.send_typing(channel)
    embed = ui_embed.user_ban(channel, user)
    await embed.send()

    try:
        response = "You have been banned from the server '{}' " \
                   "contact the owners to resolve this issue.".format(channel.server.name)
        await client.send_message(user, response)
    except Exception as e:
        logger.exception(e)