def parse_threshold()

in src/responsibleai/rai_analyse/create_score_card.py [0:0]


def parse_threshold(threshold):
    norm_th = threshold.replace(" ", "")
    match = re.search(threshold_reg, norm_th)

    if not match:
        _logger.warning(
            "Unable to parse argument threshold {}. "
            "Please refer to documentation for acceptable input.".format(threshold)
        )
        return None, None

    target_type, target_arg = match.group(1, 2)

    try:
        target_arg = float(target_arg)
    except Exception as ex:
        _logger.warning(
            "Unable to parse argument threshold {}. "
            "Please refer to documentation for acceptable input.".format(threshold)
        )
        _logger.warning(
            "Exception message included which may be useful for your reference: {}".format(
                ex
            )
        )
    return target_type, target_arg