code: def extract_comments(node, code, comments, lang):
      if len(node.children) == 0:
          if node.type in comment_node_name[lang]:
              comment_dict = {
                  "content": code[
                      node.start_byte : node.end_byte
                  ].decode("UTF-8"),
                  "range": list(
                      range(
                          node.start_point[0] + 1, node.end_point[0] + 2
                      )
                  ),
                  "start_byte": node.start_byte,
                  "end_byte": node.end_byte,
                  "type": node.type,
              }
              if comment_dict not in comments:
                  comments.append(comment_dict)
      for child in node.children:
          if child.type in comment_node_name[lang]:
              comment_dict = {
                  "content": code[
                      child.start_byte : child.end_byte
                  ].decode("UTF-8"),
                  "range": list(
                      range(
                          child.start_point[0] + 1,
                          child.end_point[0] + 2,
                      )
                  ),
                  "start_byte": child.start_byte,
                  "end_byte": child.end_byte,
                  "type": child.type,
              }
              if comment_dict not in comments:
                  comments.append(comment_dict)
          comments = extract_comments(child, code, comments, lang)
      return comments
  
file_path: magicoder/experiments/extract_function_comment_pairs.py
imports: import os
  import json
  import argparse
  from tree_sitter import Language, Parser
  from pathlib import Path
  from treelib import Node, Tree
  from tqdm import tqdm
label_desc: Use image node_id 4 for calling a global function with example usage: extract_comments(node, code, comments, lang) and returns: comments