def get_dist_dependencies(name, recurse=True):
dist = pkg_resources.get_distribution(name)<EOL>pkg_name = convert_name(dist.project_name)<EOL>reqs = set()<EOL>working = set([dist])<EOL>depth = <NUM_LIT:0><EOL>while working:<EOL><INDENT>deps = set()<EOL>for distname in working:<EOL><INDENT>dist = pkg_resources.get_distribution(distname)<EOL>pkg_name = convert_name(dist.project_name)<EOL>reqs.add(pkg_name)<EOL>for req in dist.requires():<EOL><INDENT>reqs_ = convert_requirement(req)<EOL>deps |= set(x.split('<STR_LIT:->', <NUM_LIT:1>)[<NUM_LIT:0>] for x in reqs_<EOL>if not x.startswith('<STR_LIT:!>'))<EOL><DEDENT><DEDENT>working = deps - reqs<EOL>depth += <NUM_LIT:1><EOL>if (not recurse) and (depth >= <NUM_LIT:2>):<EOL><INDENT>break<EOL><DEDENT><DEDENT>return reqs<EOL>
Get the dependencies of the given, already installed distribution.
@param recurse If True, recursively find all dependencies.
@returns A set of package names.
@note The first entry in the list is always the top-level package itself.