code: def links_from_json(obj):
      """
      Example line from sphinx-formatted redirects:
  
          "training-apis/best-practices": "../index.html",
  
      Note that the key is the src and the val is the dst, relative to the src.
  
      Also note that the key has no extension but the value does.
  
      Instead, we would like to work with paths which are always relative to the docs/ dir,
      and we would like to not have to think about extensions.
      """
      out = []
      for key, val in obj.items():
          fulldst = os.path.normpath(
              os.path.join(os.path.dirname(key), val)
          )
          dst, _ = os.path.splitext(fulldst)
          out.append(Link(key, dst))
      return out
  
file_path: determined/docs/redirects.py
imports: import argparse
  import collections
  import itertools
  import json
  import os
  import pathlib
  import subprocess
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: links_from_json(obj) and returns: out