def __get_sentence(counts, sentence_id=None):
<EOL>cursor = CONN.cursor()<EOL>check_query = "<STR_LIT>"<EOL>cursor.execute(check_query)<EOL>check_result = cursor.fetchall()<EOL>id_list = []<EOL>id_to_fetch = None<EOL>for row in check_result:<EOL><INDENT>id_list.append(row[<NUM_LIT:0>])<EOL><DEDENT>if sentence_id is not None:<EOL><INDENT>if type(sentence_id) is int:<EOL><INDENT>id_to_fetch = sentence_id<EOL><DEDENT><DEDENT>else:<EOL><INDENT>id_to_fetch = random.randint(<NUM_LIT:1>, counts['<STR_LIT>'])<EOL>while id_to_fetch not in id_list:<EOL><INDENT>id_to_fetch = random.randint(<NUM_LIT:1>, counts['<STR_LIT>'])<EOL><DEDENT><DEDENT>query = ("<STR_LIT>".format(id_to_fetch))<EOL>cursor.execute(query)<EOL>result = cursor.fetchone()<EOL>return result<EOL>
Let's fetch a random sentence that we then need to substitute bits of...
    @
    :param counts:
    :param sentence_id: