def get_egg_info(cfg, verbose=False):
result = Bunch()<EOL>setup_py = cfg.rootjoin('<STR_LIT>')<EOL>if not os.path.exists(setup_py):<EOL><INDENT>return result<EOL><DEDENT>egg_info = shell.capture("<STR_LIT>".format(setup_py), echo=True if verbose else None)<EOL>for info_line in egg_info.splitlines():<EOL><INDENT>if info_line.endswith('<STR_LIT>'):<EOL><INDENT>pkg_info_file = info_line.split(None, <NUM_LIT:1>)[<NUM_LIT:1>]<EOL>result['<STR_LIT>'] = pkg_info_file<EOL>with io.open(pkg_info_file, encoding='<STR_LIT:utf-8>') as handle:<EOL><INDENT>lastkey = None<EOL>for line in handle:<EOL><INDENT>if line.lstrip() != line:<EOL><INDENT>assert lastkey, "<STR_LIT>".format(pkg_info_file, line)<EOL>result[lastkey] += '<STR_LIT:\n>' + line<EOL><DEDENT>else:<EOL><INDENT>lastkey, value = line.split('<STR_LIT::>', <NUM_LIT:1>)<EOL>lastkey = lastkey.strip().lower().replace('<STR_LIT:->', '<STR_LIT:_>')<EOL>value = value.strip()<EOL>if lastkey in result:<EOL><INDENT>try:<EOL><INDENT>result[lastkey].append(value)<EOL><DEDENT>except AttributeError:<EOL><INDENT>result[lastkey] = [result[lastkey], value]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>result[lastkey] = value<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>for multikey in PKG_INFO_MULTIKEYS:<EOL><INDENT>if not isinstance(result.get(multikey, []), list):<EOL><INDENT>result[multikey] = [result[multikey]]<EOL><DEDENT><DEDENT>return result<EOL>
Call 'setup egg_info' and return the parsed meta-data.