code: def get_num_samples(org_dir, file_names):
      """
      Function for obtaining the number of samples
  
      :param org_dir: original directory storing the tree files
      :param file_names: list of file names in the directory
      :return: number of samples
      """
      count = 0
      # Loop through the files, which then loop through the trees
      for filename in file_names:
          # Skip files that are not .mrg
          if not filename.endswith(".mrg"):
              continue
          # File is .mrg. Start processing
          file_dir = os.path.join(org_dir, filename)
          with open(file_dir, "r", encoding="utf-8") as reader:
              content = reader.readlines()
              for _ in content:
                  count += 1
  
      return count
  
imports: import os
  import argparse
  import random
label_desc: Use image node_id 3 for calling a global function with example usage: get_num_samples(org_dir, file_names) and returns: count