def plugin_name_by_uri(uri):
<EOL>parsed = urlparse(uri)<EOL>basename = os.path.basename(parsed.path)<EOL>if not basename.strip():<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>plugin_name = basename.split("<STR_LIT:.>")[-<NUM_LIT:1>].lower()<EOL>if plugin_name in FILE_EXTENSIONS:<EOL><INDENT>plugin_name = MIME_TYPE_TO_PLUGIN_NAME[FILE_EXTENSIONS[plugin_name]]<EOL><DEDENT>return plugin_name<EOL>
Return the plugin name based on the URI