class_docstr: The environment in which the ReST files are translated.
  Stores an inventory of cross-file targets and provides doctree
  transformations to resolve links to them.
class_docstr_tok: ["The","environment","in","which","the","ReST","files","are","translated",".","Stores","an","inventory","of","cross-file","targets","and","provides","doctree","transformations","to","resolve","links","to","them","."]
docstr: Return paths to a file referenced from a document, relative to
  documentation root and absolute.
  
  In the input "filename", absolute filenames are taken as relative to the
  source dir, while relative filenames are relative to the dir of the
  containing document.
code: def relfn2path(
      self, filename: str, docname: str | None = None
  ) -> tuple[str, str]:
      """Return paths to a file referenced from a document, relative to
      documentation root and absolute.
  
      In the input "filename", absolute filenames are taken as relative to the
      source dir, while relative filenames are relative to the dir of the
      containing document.
      """
      filename = os_path(filename)
      if filename.startswith(("/", os.sep)):
          rel_fn = filename[1:]
      else:
          docdir = path.dirname(
              self.doc2path(docname or self.docname, base=False)
          )
          rel_fn = path.join(docdir, filename)
  
      return (
          canon_path(path.normpath(rel_fn)),
          path.normpath(path.join(self.srcdir, rel_fn)),
      )
  
imports: from __future__ import annotations
  import functools
  import os
  import pickle
  import time
  from collections import defaultdict
  from copy import copy
  from os import path
  from typing import TYPE_CHECKING, Any, Callable, NoReturn
  from sphinx import addnodes
  from sphinx.environment.adapters import toctree
  from sphinx.errors import BuildEnvironmentError, DocumentError, ExtensionError, SphinxError
  from sphinx.locale import __
  from sphinx.transforms import SphinxTransformer
  from sphinx.util import DownloadFiles, FilenameUniqDict, logging
  from sphinx.util.docutils import LoggingReporter
  from sphinx.util.i18n import CatalogRepository, docname_to_domain
  from sphinx.util.nodes import is_translatable
  from sphinx.util.osutil import canon_path, os_path
label_desc: Use image node_id 12 for calling the BuildEnvironment obj's underlying member method code with example usage: obj.relfn2path(filename, docname) and returns: canon_path,  path