def resolve_reference(ref):
if not isinstance(ref, str) or '<STR_LIT::>' not in ref:<EOL><INDENT>return ref<EOL><DEDENT>modulename, rest = ref.split('<STR_LIT::>', <NUM_LIT:1>)<EOL>try:<EOL><INDENT>obj = import_module(modulename)<EOL><DEDENT>except ImportError as e:<EOL><INDENT>raise LookupError(<EOL>'<STR_LIT>'.format(ref)) from e<EOL><DEDENT>try:<EOL><INDENT>for name in rest.split('<STR_LIT:.>'):<EOL><INDENT>obj = getattr(obj, name)<EOL><DEDENT>return obj<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise LookupError('<STR_LIT>'.format(ref))<EOL><DEDENT>
Return the object pointed to by ``ref``.
If ``ref`` is not a string or does not contain ``:``, it is returned as is.
References must be in the form  <modulename>:<varname> where <modulename> is the fully
qualified module name and varname is the path to the variable inside that module.
For example, "concurrent.futures:Future" would give you the
:class:`~concurrent.futures.Future` class.
:raises LookupError: if the reference could not be resolved