<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _include_query_example(self, f, method, path, api_version, server_type):
 """If a sample session is available we include it in documentation"""

        m = method["method"].lower()
        query_path = "{}_{}_{}.txt".format(server_type, m, self._file_path(path))
        if os.path.isfile(os.path.join(self._directory, "api", "examples", query_path)):
            f.write("Sample session\n***************\n")
            f.write("\n\n.. literalinclude:: ../../../examples/{}\n\n".format(query_path))