def get_plugin_info(plugin):
url = '<STR_LIT>'.format(plugin)<EOL>try:<EOL><INDENT>resp = request.urlopen(url)<EOL><DEDENT>except HTTPError as e:<EOL><INDENT>if e.code == <NUM_LIT>:<EOL><INDENT>raise NameError("<STR_LIT>".format(plugin))<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(<EOL>url, resp.getcode()<EOL>)<EOL>)<EOL><DEDENT><DEDENT>try:<EOL><INDENT>json_resp = json.loads(resp.read().decode())<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(url)<EOL>)<EOL><DEDENT>return json_resp['<STR_LIT:info>']<EOL>
Fetch information about the given package on PyPI and return it as a dict.
If the package cannot be found on PyPI, :exc:`NameError` will be raised.