(g_wn, g_wc, g_sql_i, pr_sql_i, mode)
return cnt_list
usalbe only when g_wc was used to find pr_wv
usalbe only when g_wc was used to find pr_wv
usalbe only when g_wc was used to find pr_wv
def get_cnt_wv_list(g_wn, g_wc, g_sql_i, pr_sql_i, mode):
    """ usalbe only when g_wc was used to find pr_wv
    """
    cnt_list =[]
    for b, g_wc1 in enumerate(g_wc):
        pr_wn1 = len(pr_sql_i[b]["conds"])
        g_wn1 = g_wn[b]

        # Now sorting.
        # Sort based wc sequence.
        if mode == 'test':
            idx1 = argsort(array(g_wc1))
        elif mode == 'train':
            idx1 = list( range( g_wn1) )
        else:
            raise ValueError

        if g_wn1 != pr_wn1:
            cnt_list.append(0)
            continue
        else:
            flag = True
            for i_wn, idx11 in enumerate(idx1):
                g_wvi_str11 = str(g_sql_i[b]["conds"][idx11][2]).lower()
                pr_wvi_str11 = str(pr_sql_i[b]["conds"][i_wn][2]).lower()
                # print(g_wvi_str11)
                # print(pr_wvi_str11)
                # print(g_wvi_str11==pr_wvi_str11)
                if g_wvi_str11 != pr_wvi_str11:
                    flag = False
                    # print(g_wv1, g_wv11)
                    # print(pr_wv1, pr_wv11)
                    # input('')
                    break
            if flag:
                cnt_list.append(1)
            else:
                cnt_list.append(0)

    return cnt_list
def get_cnt_wv_list ( g_wn , g_wc , g_sql_i , pr_sql_i , mode ) : cnt_list = [ ] for b , g_wc1 in enumerate ( g_wc ) : pr_wn1 = len ( pr_sql_i [ b ] [ "conds" ] ) g_wn1 = g_wn [ b ] # Now sorting. # Sort based wc sequence. if mode == 'test' : idx1 = argsort ( array ( g_wc1 ) ) elif mode == 'train' : idx1 = list ( range ( g_wn1 ) ) else : raise ValueError if g_wn1 != pr_wn1 : cnt_list . append ( 0 ) continue else : flag = True for i_wn , idx11 in enumerate ( idx1 ) : g_wvi_str11 = str ( g_sql_i [ b ] [ "conds" ] [ idx11 ] [ 2 ] ) . lower ( ) pr_wvi_str11 = str ( pr_sql_i [ b ] [ "conds" ] [ i_wn ] [ 2 ] ) . lower ( ) # print(g_wvi_str11) # print(pr_wvi_str11) # print(g_wvi_str11==pr_wvi_str11) if g_wvi_str11 != pr_wvi_str11 : flag = False # print(g_wv1, g_wv11) # print(pr_wv1, pr_wv11) # input('') break if flag : cnt_list . append ( 1 ) else : cnt_list . append ( 0 ) return cnt_list