def strip_project_url(url):
m = re.match(r'<STR_LIT>', url)<EOL>if m:<EOL><INDENT>url = m.group(<NUM_LIT:1>)<EOL><DEDENT>if url.endswith('<STR_LIT>'):<EOL><INDENT>url, _, _ = url.rpartition('<STR_LIT:.>')<EOL><DEDENT>if url.endswith('<STR_LIT>'):<EOL><INDENT>url, _, _ = url.rpartition('<STR_LIT:->')<EOL><DEDENT>if url.startswith('<STR_LIT>'):<EOL><INDENT>_, _, url = url.partition('<STR_LIT:/>')<EOL><DEDENT>return url<EOL>
strip proto:// | openstack/ prefixes and .git | -distgit suffixes