def get_thread(thread_uid, last_comment=False, counter=False):
thread = content.hgetall(build_key(THREAD_KEY, thread_uid))<EOL>if not thread:<EOL><INDENT>return thread<EOL><DEDENT>last_comment_uid = thread.get('<STR_LIT>')<EOL>if last_comment and last_comment_uid:<EOL><INDENT>comment_key = build_key(COMMENT_KEY, thread_uid, last_comment_uid)<EOL>thread['<STR_LIT>'] = content.hgetall(comment_key)<EOL><DEDENT>if counter:<EOL><INDENT>counter_key = build_key(THREAD_COUNTER_KEY, thread_uid)<EOL>thread['<STR_LIT>'] = links.get(counter_key)<EOL><DEDENT>return thread<EOL>
Read thread metadata by specefied UID.

    :param thread_uid: Thread unique ID.
    :param last_comment: Include last comment metadata or not?
    :param counter: Include comments counter or not?