def pydeps2reqs(deps):
reqs = defaultdict(set)<EOL>for k, v in list(deps.items()):<EOL><INDENT>p = v['<STR_LIT:path>']<EOL>if p and not p.startswith(sys.real_prefix):<EOL><INDENT>if p.startswith(sys.prefix) and '<STR_LIT>' in p:<EOL><INDENT>if not p.endswith('<STR_LIT>'):<EOL><INDENT>if '<STR_LIT>' in p.replace('<STR_LIT:\\>', '<STR_LIT:/>'):<EOL><INDENT>reqs['<STR_LIT:win32>'] |= set(v['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>name = k.split('<STR_LIT:.>', <NUM_LIT:1>)[<NUM_LIT:0>]<EOL>if name not in skiplist:<EOL><INDENT>reqs[name] |= set(v['<STR_LIT>'])<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>if '<STR_LIT>' in reqs:<EOL><INDENT>del reqs['<STR_LIT>']<EOL><DEDENT>return '<STR_LIT:\n>'.join(dep2req(name, reqs[name]) for name in sorted(reqs))<EOL>
Convert a deps instance into requirements.