def getmodpath(self, stopatmodule=True, includemodule=False):
chain = self.listchain()<EOL>chain.reverse()<EOL>parts = []<EOL>for node in chain:<EOL><INDENT>if isinstance(node, Instance):<EOL><INDENT>continue<EOL><DEDENT>name = node.name<EOL>if isinstance(node, Module):<EOL><INDENT>name = os.path.splitext(name)[<NUM_LIT:0>]<EOL>if stopatmodule:<EOL><INDENT>if includemodule:<EOL><INDENT>parts.append(name)<EOL><DEDENT>break<EOL><DEDENT><DEDENT>parts.append(name)<EOL><DEDENT>parts.reverse()<EOL>s = "<STR_LIT:.>".join(parts)<EOL>return s.replace("<STR_LIT>", "<STR_LIT:[>")<EOL>
return python path relative to the containing module.