def check_package_set(package_set, should_ignore=None):<EOL>
if should_ignore is None:<EOL><INDENT>def should_ignore(name):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>missing = dict()<EOL>conflicting = dict()<EOL>for package_name in package_set:<EOL><INDENT>missing_deps = set()  <EOL>conflicting_deps = set()  <EOL>if should_ignore(package_name):<EOL><INDENT>continue<EOL><DEDENT>for req in package_set[package_name].requires:<EOL><INDENT>name = canonicalize_name(req.project_name)  <EOL>if name not in package_set:<EOL><INDENT>missed = True<EOL>if req.marker is not None:<EOL><INDENT>missed = req.marker.evaluate()<EOL><DEDENT>if missed:<EOL><INDENT>missing_deps.add((name, req))<EOL><DEDENT>continue<EOL><DEDENT>version = package_set[name].version  <EOL>if not req.specifier.contains(version, prereleases=True):<EOL><INDENT>conflicting_deps.add((name, version, req))<EOL><DEDENT><DEDENT>if missing_deps:<EOL><INDENT>missing[package_name] = sorted(missing_deps, key=str)<EOL><DEDENT>if conflicting_deps:<EOL><INDENT>conflicting[package_name] = sorted(conflicting_deps, key=str)<EOL><DEDENT><DEDENT>return missing, conflicting<EOL>
Check if a package set is consistent

    If should_ignore is passed, it should be a callable that takes a
    package name and returns a boolean.