examples/text_to_sql/RAT-SQL/text2sql/utils/dusql_evaluation.py
def eval_having(pred, gold):
    """and/or will be evaluate in other branch
    """
    if len(pred['having']) != len(gold['having']):
        return [1, 1, 0]

    pred_total = len(pred['having'][::2])
    gold_total = len(gold['having'][::2])
    cnt = 0
    for pred_cond, gold_cond in zip(
            sorted(pred['having'][::2]), sorted(gold['having'][::2])):
        if eval_cond(pred_cond, gold_cond) == 1:
            cnt += 1

    return [gold_total, pred_total, cnt]
and/or will be evaluate in other branch
    
and/or will be evaluate in other branch
and / or will be evaluate in other branch
def eval_having(pred, gold):
    if len(pred['having']) != len(gold['having']):
        return [1, 1, 0]
    pred_total = len(pred['having'][::2])
    gold_total = len(gold['having'][::2])
    cnt = 0
    for pred_cond, gold_cond in zip(
            sorted(pred['having'][::2]), sorted(gold['having'][::2])):
        if eval_cond(pred_cond, gold_cond) == 1:
            cnt += 1
    return [gold_total, pred_total, cnt]
def eval_having ( pred , gold ) : if len ( pred [ 'having' ] ) != len ( gold [ 'having' ] ) : return [ 1 , 1 , 0 ] pred_total = len ( pred [ 'having' ] [ : : 2 ] ) gold_total = len ( gold [ 'having' ] [ : : 2 ] ) cnt = 0 for pred_cond , gold_cond in zip ( sorted ( pred [ 'having' ] [ : : 2 ] ) , sorted ( gold [ 'having' ] [ : : 2 ] ) ) : if eval_cond ( pred_cond , gold_cond ) == 1 : cnt += 1 return [ gold_total , pred_total , cnt ]
and/or will be evaluate in other branch
and / or will be evaluate in other branch
"""and/or will be evaluate in other branch
    """
pred
gold