<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_cluster_config( cluster_type, cluster_name=None, kafka_topology_base_path=None, ):
 """Return the cluster configuration. Use the local cluster if cluster_name is not specified. :param cluster_type: the type of the cluster :type cluster_type: string :param cluster_name: the name of the cluster :type cluster_name: string :param kafka_topology_base_path: base path to look for <cluster_type>.yaml :type cluster_name: string :returns: the cluster :rtype: ClusterConfig """

    if not kafka_topology_base_path:
        config_dirs = get_conf_dirs()
    else:
        config_dirs = [kafka_topology_base_path]

    topology = None
    for config_dir in config_dirs:
        try:
            topology = TopologyConfiguration(
                cluster_type,
                config_dir,
            )
        except MissingConfigurationError:
            pass
    if not topology:
        raise MissingConfigurationError(
            "No available configuration for type {0}".format(cluster_type),
        )

    if cluster_name:
        return topology.get_cluster_by_name(cluster_name)
    else:
        return topology.get_local_cluster()