def make_graph(dists, scheme='<STR_LIT:default>'):
scheme = get_scheme(scheme)<EOL>graph = DependencyGraph()<EOL>provided = {}  <EOL>for dist in dists:<EOL><INDENT>graph.add_distribution(dist)<EOL>for p in dist.provides:<EOL><INDENT>name, version = parse_name_and_version(p)<EOL>logger.debug('<STR_LIT>', name, version, dist)<EOL>provided.setdefault(name, []).append((version, dist))<EOL><DEDENT><DEDENT>for dist in dists:<EOL><INDENT>requires = (dist.run_requires | dist.meta_requires |<EOL>dist.build_requires | dist.dev_requires)<EOL>for req in requires:<EOL><INDENT>try:<EOL><INDENT>matcher = scheme.matcher(req)<EOL><DEDENT>except UnsupportedVersionError:<EOL><INDENT>logger.warning('<STR_LIT>',<EOL>req)<EOL>name = req.split()[<NUM_LIT:0>]<EOL>matcher = scheme.matcher(name)<EOL><DEDENT>name = matcher.key   <EOL>matched = False<EOL>if name in provided:<EOL><INDENT>for version, provider in provided[name]:<EOL><INDENT>try:<EOL><INDENT>match = matcher.match(version)<EOL><DEDENT>except UnsupportedVersionError:<EOL><INDENT>match = False<EOL><DEDENT>if match:<EOL><INDENT>graph.add_edge(dist, provider, req)<EOL>matched = True<EOL>break<EOL><DEDENT><DEDENT><DEDENT>if not matched:<EOL><INDENT>graph.add_missing(dist, req)<EOL><DEDENT><DEDENT><DEDENT>return graph<EOL>
Makes a dependency graph from the given distributions.

    :parameter dists: a list of distributions
    :type dists: list of :class:`distutils2.database.InstalledDistribution` and
                 :class:`distutils2.database.EggInfoDistribution` instances
    :rtype: a :class:`DependencyGraph` instance