code: def rename_into(links, published, src, dst, drop_src_root=False):
      """
      Rename many things into a directory.
  
      drop_src_root=True indicates a `mv thing newdir/`, where `thing` isn't going to appear in the
      final destination path for any elements of `thing/`, because it will be called `newdir/`
      instead.
      """
      if not os.path.isdir(src):
          # src=basepath/base.rst, dst=dstpath/dst
          # result=dstpath/dst/base.rst
          result = os.path.join(dst, os.path.basename(src))
          return rename_one(links, published, src, result)
      for root, _, files in os.walk(src):
          for file in files:
              # src=basepath/base/, dst=dstpath/dst
              # root=basepath/base/a/b/c, file=d
              # fullsrc=basepath/base/a/b/c/d
              # fulldst=dstpath/dst/[base/]a/b/c/d
              fullsrc = os.path.relpath(
                  os.path.join(root, file), start=HERE
              )
              if drop_src_root:
                  # The fulldst=dstpath/dst/a/b/c/d case (remove basepath/base/).
                  relsrc = os.path.relpath(fullsrc, start=src)
              else:
                  # The fulldst=dstpath/dst/base/a/b/c/d case (remove just basepath/).
                  relsrc = os.path.relpath(
                      fullsrc, start=os.path.dirname(src)
                  )
              fulldst = os.path.join(dst, relsrc)
              links = rename_one(links, published, fullsrc, fulldst)
      return links
  
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 5 for calling a global function with example usage: rename_into(links, published, src, dst, drop_src_root) and returns: links, rename_one