code: def printdeps(obj,              # type: Mapping[Text, Any]
                document_loader,  # type: Loader
                stdout,           # type: Union[TextIO, StreamWriter]
                relative_deps,    # type: bool
                uri,              # type: Text
                basedir=None,     # type: Text
                nestdirs=True     # type: bool
               ):  # type: (...) -> None
      
      deps = find_deps(obj, document_loader, uri, basedir=basedir,
                       nestdirs=nestdirs)
      if relative_deps == "primary":
          base = basedir if basedir else os.path.dirname(uri_file_path(str(uri)))
      elif relative_deps == "cwd":
          base = os.getcwd()
      visit_class(deps, ("File", "Directory"), functools.partial(
          make_relative, base))
      stdout.write(json_dumps(deps, indent=4))
docs: Print a JSON representation of the dependencies of the CWL document.