def autolink_role(typ, rawtext, etext, lineno, inliner,<EOL>options={}, content=[]):
env = inliner.document.settings.env<EOL>r = env.get_domain('<STR_LIT>').role('<STR_LIT>')(<EOL>'<STR_LIT>', rawtext, etext, lineno, inliner, options, content)<EOL>pnode = r[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>prefixes = get_import_prefixes_from_env(env)<EOL>try:<EOL><INDENT>name, obj, parent = import_by_name(pnode['<STR_LIT>'], prefixes)<EOL><DEDENT>except ImportError:<EOL><INDENT>content = pnode[<NUM_LIT:0>]<EOL>r[<NUM_LIT:0>][<NUM_LIT:0>] = nodes.emphasis(rawtext, content[<NUM_LIT:0>].astext(),<EOL>classes=content['<STR_LIT>'])<EOL><DEDENT>return r<EOL>
Smart linking role.

    Expands to ':obj:`text`' if `text` is an object that can be imported;
    otherwise expands to '*text*'.