def acceptedId(connection,cd_tax:int):
    """
    Returns the cd_tax of the accepted taxon corresponding to the cd_tax given in parameter (either returns the same cd_tax if the taxon is accepted, or its cd_syno if the taxon is a synonym)
    
    Parameters
    ----------
    connection: psycopg2 connection
        connection to the postgres database
    cd_tax: int
        cd_tax of the taxon
    Returns
    -----------
    cd_tax of the accepted corresponding taxon
    """
    cur = connection.cursor()
    SQL = "SELECT COALESCE(cd_syno,cd_tax) FROM taxon WHERE cd_tax=%s"
    cur.execute(SQL,[cd_tax])
    res, =cur.fetchone()
    cur.close()
    return res