def resolve_reference_to_epydoc(app, env, node, contnode):
domain = node.get('<STR_LIT>')<EOL>if domain != '<STR_LIT>':<EOL><INDENT>return<EOL><DEDENT>target = node['<STR_LIT>']<EOL>mapping = app.config.epydoc_mapping<EOL>matching_baseurls = (baseurl for baseurl in mapping if<EOL>any(re.match(p, target) for p in mapping[baseurl]))<EOL>baseurl = next(matching_baseurls, None)<EOL>if not baseurl:<EOL><INDENT>return<EOL><DEDENT>objtype = env.domains[domain].objtypes_for_role(node['<STR_LIT>'])[<NUM_LIT:0>]<EOL>fn = filename_for_object(objtype, target)<EOL>uri = posixpath.join(baseurl, fn)<EOL>newobjtype = posixpath.splitext(fn)[<NUM_LIT:0>].rsplit('<STR_LIT:->', <NUM_LIT:1>)[-<NUM_LIT:1>]<EOL>title = '<STR_LIT>'.format(target, newobjtype, baseurl)<EOL>newnode = nodes.reference('<STR_LIT>', '<STR_LIT>')<EOL>newnode['<STR_LIT:class>'] = '<STR_LIT>'<EOL>newnode['<STR_LIT>'] = uri<EOL>newnode['<STR_LIT>'] = title<EOL>newnode.append(contnode)<EOL>return newnode<EOL>
Resolve a reference to an epydoc documentation.