code: def mkrecord(hier, words, path, typ, order):
      hierarchy = {
          "lvl0": None,
          "lvl1": None,
          "lvl2": None,
          "lvl3": None,
          "lvl4": None,
          "lvl5": None,
          "lvl6": None,
      }
      for i, h in enumerate(hier):
          hierarchy[f"lvl{i}"] = h
      content = (
          " ".join(html.unescape(w) for w in words) if words else None
      )
      record = {
          "recordVersion": "v3",
          "hierarchy": hierarchy,
          # Upload a partial path relative to the docroot.  The docs javascript will combine the
          # path to the docroot with this partial path for a relative path from anywhere in the docs
          # to this result.
          "url": path,
          "content": content,
          "type": typ,
          "lang": "en",
          "language": "en",
          "weight": {
              "pageRank": 0,
              "level": 0 if content else 110 - 10 * len(hier),
              "position": order,
          },
      }
      return record
  
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 1 for calling a global function with example usage: mkrecord(hier, words, path, typ, order) and returns: record