def METHOD_NAME(json_file, out_file=None, test_sample_num=None, query_answer_path=None):
    with open(json_file, "r", encoding="utf-8") as rf:
        if out_file:
            wf = open(os.path.join(out_file), "w", encoding="utf-8")
        if query_answer_path:
            qeury_answer_wf = open(query_answer_path, "w", encoding="utf-8")
        q_list = []
        for i, json_line in enumerate(rf.readlines()):
            line_dict = json.loads(json_line)
            if isinstance(line_dict["question"], list):
                question = line_dict["question"][0]
            else:
                question = line_dict["question"]
            answer = line_dict["answer"]
            if not test_sample_num or i < test_sample_num:
                if query_answer_path:
                    qeury_answer_wf.write(
                        question.replace("\n", " ").replace("\t", " ").strip()
                        + "\t"
                        + answer.replace("\n", " ").replace("\t", " ").strip()
                        + "\n"
                    )
                if out_file:
                    wf.write(question.replace("\n", " ").replace("\t", " ").strip() + "\n")
                q_list.append(question.strip())
            else:
                break
        if query_answer_path:
            qeury_answer_wf.close()
        if out_file:
            wf.colse()
        return q_list