code: def script_string_to_notebook_with_links(str, pth, cr=None):
      
  
      if cr is None:
          script_string_to_notebook(str, pth)
      else:
          ntbk = script_string_to_notebook_object(str)
          notebook_substitute_ref_with_url(ntbk, cr)
          with open(pth, 'wt') as f:
              nbformat.write(ntbk, f)
docs: Convert a python script represented as string `str` to a notebook
      with filename `pth` and replace sphinx cross-references with links
      to online docs. Parameter `cr` is a CrossReferenceLookup object.