<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def user_create(name,
                passwd,
                database=None,
                user=None,
                password=None,
                host=None,
                port=None):
    '''
    Create a cluster admin or a database user.

    If a database is specified: it will create database user.
    If a database is not specified: it will create a cluster admin.

    name
        User name for the new user to create

    passwd
        Password for the new user to create

    database
        The database to create the user in

    user
        The user to connect as

    password
        The password of the user

    host
        The host to connect to

    port
        The port to connect to

    CLI Example:

    .. code-block:: bash

        salt '*' influxdb08.user_create <name> <passwd>
        salt '*' influxdb08.user_create <name> <passwd> <database>
        salt '*' influxdb08.user_create <name> <passwd> <database> <user> <password> <host> <port>
    '''
    if user_exists(name, database, user, password, host, port):
        if database:
            log.info('User \'%s\' already exists for DB \'%s\'', name, database)
        else:
            log.info('Cluster admin \'%s\' already exists', name)
        return False

    client = _client(user=user, password=password, host=host, port=port)

    if not database:
        return client.add_cluster_admin(name, passwd)

    client.switch_database(database)
    return client.add_database_user(name, passwd)