def load_patterns(cur, pat_table_name):
    """
        load pre-defined constraints(currently only fixed attributes and variable attributes)
    """
    global_pattern_table = pat_table_name + '_global'
    load_query = 'SELECT * FROM {};'.format(global_pattern_table)
    cur.execute(load_query)
    res = cur.fetchall()
    print(res)
    patterns = []
    for pat in res:
        if pat[0].find('community_area') != -1 and pat[0].find('district'
            ) != -1:
            continue
        if pat[1].find('community_area') != -1 and pat[1].find('district'
            ) != -1:
            continue
        if pat[0].find('community_area') != -1 and pat[1].find('district'
            ) != -1:
            continue
        if pat[1].find('community_area') != -1 and pat[0].find('district'
            ) != -1:
            continue
        patterns.append(list(pat))
        patterns[-1][0] = patterns[-1][0][1:-1].replace(' ', '').split(',')
        patterns[-1][1] = patterns[-1][1][1:-1].replace(' ', '').split(',')
    return patterns
