def insert_symbol_mapping(raw_data_id, symbol_id, user_id, strokes):
    """
    Insert data into `wm_strokes_to_symbol`.

    Parameters
    ----------
    raw_data_id : int
    user_id : int
    strokes: list of int
    """
    mysql = utils.get_mysql_cfg()
    connection = pymysql.connect(host=mysql['host'],
                                 user=mysql['user'],
                                 passwd=mysql['passwd'],
                                 db=mysql['db'],
                                 charset='utf8mb4',
                                 cursorclass=pymysql.cursors.DictCursor)
    cursor = connection.cursor()
    sql = ("INSERT INTO `wm_partial_answer` "
           "(`recording_id`, `symbol_id`, `strokes`, `user_id`, "
           "`is_accepted`) "
           "VALUES (%s, %s, %s, %s, 1);")
    data = (raw_data_id,
            symbol_id,
            ",".join([str(stroke) for stroke in strokes]),
            user_id)
    cursor.execute(sql, data)
    connection.commit()
def insert_symbol_mapping ( raw_data_id , symbol_id , user_id , strokes ) : mysql = utils . get_mysql_cfg ( ) connection = pymysql . connect ( host = mysql [ 'host' ] , user = mysql [ 'user' ] , passwd = mysql [ 'passwd' ] , db = mysql [ 'db' ] , charset = 'utf8mb4' , cursorclass = pymysql . cursors . DictCursor ) cursor = connection . cursor ( ) sql = ( "INSERT INTO `wm_partial_answer` " "(`recording_id`, `symbol_id`, `strokes`, `user_id`, " "`is_accepted`) " "VALUES (%s, %s, %s, %s, 1);" ) data = ( raw_data_id , symbol_id , "," . join ( [ str ( stroke ) for stroke in strokes ] ) , user_id ) cursor . execute ( sql , data ) connection . commit ( )
Insert data into `wm_strokes_to_symbol`.

    Parameters
    ----------
    raw_data_id : int
    user_id : int
    strokes: list of int