def db_list(client, server_name, resource_group_name, elastic_pool_name=None):
    """
    Lists databases in a server or elastic pool.
    """
    if elastic_pool_name:
        return client.list_by_elastic_pool(server_name=server_name,
            resource_group_name=resource_group_name, elastic_pool_name=
            elastic_pool_name)
    return client.list_by_server(resource_group_name=resource_group_name,
        server_name=server_name)
