def _resolve_name(name, package, level):
if not hasattr(package, '<STR_LIT>'):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>dot = len(package)<EOL>for x in xrange(level, <NUM_LIT:1>, -<NUM_LIT:1>):<EOL><INDENT>try:<EOL><INDENT>dot = package.rindex('<STR_LIT:.>', <NUM_LIT:0>, dot)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>return "<STR_LIT>" % (package[:dot], name)<EOL>
Return the absolute name of the module to be imported.