def get_coverage(config: CoverageConfig) -> 'Coverage':
    """
    Returns a Coverage instance.

    :param config: Coverage configuration.
    :return: Instance of Coverage.
    """
    if config.type == C.COVERAGE_COUNT or config.type == C.COVERAGE_FERTILITY:
        utils.check_condition(config.num_hidden == 1, "Count or fertility coverage requires coverage_num_hidden==1")
    if config.type == C.GRU_TYPE:
        return GRUCoverage(config.num_hidden, config.layer_normalization)
    elif config.type in {C.TANH, C.SIGMOID, C.RELU, C.SOFT_RELU}:
        return ActivationCoverage(config.num_hidden, config.type, config.layer_normalization)
    elif config.type == C.COVERAGE_COUNT:
        return CountCoverage()
    elif config.type == C.COVERAGE_FERTILITY:
        return FertilityCoverage(config.max_fertility)
    else:
        raise ValueError("Unknown coverage type %s" % config.type)
Returns a Coverage instance.

    :param config: Coverage configuration.
    :return: Instance of Coverage.