def proc_requirements(mobj):
pyvers = ["<STR_LIT>".format(item.replace("<STR_LIT:.>", "<STR_LIT>")) for item in get_supported_interps()]<EOL>py2vers = sorted([item for item in pyvers if item.startswith("<STR_LIT>")])<EOL>py3vers = sorted([item for item in pyvers if item.startswith("<STR_LIT>")])<EOL>fdict = json_load(os.path.join("<STR_LIT:data>", "<STR_LIT>"))<EOL>olines = ["<STR_LIT>"]<EOL>sdict = dict([(item["<STR_LIT:name>"], item) for item in fdict.values()])<EOL>for real_name in sorted(sdict.keys()):<EOL><INDENT>pkg_dict = sdict[real_name]<EOL>if pkg_dict["<STR_LIT>"] == ["<STR_LIT>"]:<EOL><INDENT>continue<EOL><DEDENT>plist = [] if not pkg_dict["<STR_LIT>"] else ["<STR_LIT>"]<EOL>if isinstance(pkg_dict["<STR_LIT>"], str):<EOL><INDENT>pkg_dict["<STR_LIT>"] = dict([(pyver, pkg_dict["<STR_LIT>"]) for pyver in pyvers])<EOL><DEDENT>pkg_pyvers = sorted(pkg_dict["<STR_LIT>"].keys())<EOL>pkg_py2vers = sorted(<EOL>[item for item in pkg_dict["<STR_LIT>"].keys() if item.startswith("<STR_LIT>")]<EOL>)<EOL>req_vers = list(set(pkg_dict["<STR_LIT>"].values()))<EOL>req_py2vers = list(<EOL>set([pkg_dict["<STR_LIT>"][item] for item in py2vers if item in pkg_dict["<STR_LIT>"]])<EOL>)<EOL>req_py3vers = list(<EOL>set([pkg_dict["<STR_LIT>"][item] for item in py3vers if item in pkg_dict["<STR_LIT>"]])<EOL>)<EOL>if (len(req_vers) == <NUM_LIT:1>) and (pkg_pyvers == pyvers):<EOL><INDENT>plist.append(ops_to_words(req_vers[<NUM_LIT:0>]))<EOL><DEDENT>elif (<EOL>(pkg_pyvers == pyvers)<EOL>and (len(req_py2vers) == <NUM_LIT:1>)<EOL>and (len(req_py3vers) == <NUM_LIT:1>)<EOL>):<EOL><INDENT>make_common_entry(plist, "<STR_LIT:2>", "<STR_LIT>", req_py2vers[<NUM_LIT:0>])<EOL>make_common_entry(plist, "<STR_LIT:3>", "<STR_LIT>", req_py3vers[<NUM_LIT:0>])<EOL><DEDENT>elif (<EOL>(pkg_pyvers == pyvers)<EOL>and (len(req_py2vers) == len(py2vers))<EOL>and (len(req_py3vers) == <NUM_LIT:1>)<EOL>and (pkg_dict["<STR_LIT>"][pkg_py2vers[-<NUM_LIT:1>]] == req_py3vers[<NUM_LIT:0>])<EOL>):<EOL><INDENT>py2dict = dict(<EOL>[<EOL>(key, value)<EOL>for key, value in pkg_dict["<STR_LIT>"].items()<EOL>if key.startswith("<STR_LIT>") and (key != pkg_py2vers[-<NUM_LIT:1>])<EOL>]<EOL>)<EOL>make_multi_entry(plist, py2vers[:-<NUM_LIT:1>], py2dict)<EOL>pver = pkg_py2vers[-<NUM_LIT:1>][<NUM_LIT:2>] + "<STR_LIT:.>" + pkg_py2vers[-<NUM_LIT:1>][<NUM_LIT:3>:]<EOL>plist.append(<EOL>"<STR_LIT>".format(<EOL>pyver=pver, ver=ops_to_words(req_py3vers[<NUM_LIT:0>])<EOL>)<EOL>)<EOL><DEDENT>elif (<EOL>(pkg_pyvers == pyvers)<EOL>and (len(req_py2vers) == len(py2vers))<EOL>and (len(req_py3vers) == <NUM_LIT:1>)<EOL>):<EOL><INDENT>py2dict = dict(<EOL>[<EOL>(key, value)<EOL>for key, value in pkg_dict["<STR_LIT>"].items()<EOL>if key.startswith("<STR_LIT>")<EOL>]<EOL>)<EOL>make_multi_entry(plist, py2vers, py2dict)<EOL>make_common_entry(plist, "<STR_LIT:3>", "<STR_LIT>", req_py3vers[<NUM_LIT:0>])<EOL><DEDENT>elif (<EOL>(pkg_pyvers == pyvers)<EOL>and (len(req_py3vers) == len(py3vers))<EOL>and (len(req_py2vers) == <NUM_LIT:1>)<EOL>):<EOL><INDENT>py3dict = dict(<EOL>[<EOL>(key, value)<EOL>for key, value in pkg_dict["<STR_LIT>"].items()<EOL>if key.startswith("<STR_LIT>")<EOL>]<EOL>)<EOL>make_common_entry(plist, "<STR_LIT:2>", "<STR_LIT>", req_py2vers[<NUM_LIT:0>])<EOL>make_multi_entry(plist, py3vers, py3dict)<EOL><DEDENT>elif (len(req_vers) == <NUM_LIT:1>) and (pkg_pyvers == py2vers):<EOL><INDENT>make_common_entry(plist, "<STR_LIT:2>", "<STR_LIT>", req_vers[<NUM_LIT:0>])<EOL><DEDENT>elif (len(req_vers) == <NUM_LIT:1>) and (pkg_pyvers == py3vers):<EOL><INDENT>make_common_entry(plist, "<STR_LIT:3>", "<STR_LIT>", req_vers[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>make_multi_entry(plist, pkg_pyvers, pkg_dict["<STR_LIT>"])<EOL><DEDENT>olines.append(<EOL>"<STR_LIT>".format(<EOL>name=pkg_dict["<STR_LIT:name>"], par="<STR_LIT:U+002CU+0020>".join(plist)<EOL>)<EOL>)<EOL><DEDENT>ret = []<EOL>for line in olines:<EOL><INDENT>wobj = textwrap.wrap(line, width=LINE_WIDTH, subsequent_indent="<STR_LIT:U+0020>")<EOL>ret.append("<STR_LIT:\n>".join([item for item in wobj]))<EOL><DEDENT>mobj.out("<STR_LIT>".join(ret) + "<STR_LIT>")<EOL>
Get requirements in reStructuredText format.