def _namespace_from_uri(self, uri):
<EOL>uri = str(uri)<EOL>parts = uri.split('<STR_LIT:#>')<EOL>if len(parts) == <NUM_LIT:1>:<EOL><INDENT>return "<STR_LIT>" % '<STR_LIT:/>'.join(uri.split('<STR_LIT:/>')[:-<NUM_LIT:1>])<EOL><DEDENT>return "<STR_LIT>" % '<STR_LIT:#>'.join(parts[:-<NUM_LIT:1>])<EOL>
returns the expanded namespace prefix of a uri