code: def scrape_tree(root, excludes):
      root = os.path.normpath(root)
      excludes = [
          os.path.normpath(os.path.join(root, ex)) for ex in excludes
      ]
      records = []
      errors = []
  
      def exclude_dir(path):
          return any(
              os.path.relpath(path, ex) == "." for ex in excludes
          )
  
      def exclude_file(path):
          return any(path == ex for ex in excludes)
  
      for parent, dirs, files in os.walk(root):
          if exclude_dir(parent):
              print("skipping dir", parent, file=sys.stderr)
              dirs = []
              continue
          for file in files:
              _, ext = os.path.splitext(file)
              if ext != ".xml":
                  continue
              path = os.path.join(parent, file)
              if exclude_file(path):
                  print("skipping file", path, file=sys.stderr)
                  continue
              try:
                  records += extract_file(
                      root, os.path.relpath(path, root)
                  )
              except Exception as e:
                  errors.append(f"{path}: {traceback.format_exc()}")
  
      if errors:
          print("\n".join(errors), file=sys.stderr)
          exit(1)
  
      print(f"collected {len(records)} records", file=sys.stderr)
  
      return records
  
file_path: determined/docs/deploy/scrape.py
imports: import argparse
  import html
  import io
  import json
  import os
  import pathlib
  import re
  import sys
  import time
  import traceback
  from xml.etree import ElementTree
  from algoliasearch import search_client
label_desc: Use image node_id 5 for calling a global function with example usage: scrape_tree(root, excludes) and returns: records, any, any