def create_package_set_from_installed(**kwargs):<EOL>
<EOL>if kwargs == {}:<EOL><INDENT>kwargs = {"<STR_LIT>": False, "<STR_LIT>": ()}<EOL><DEDENT>package_set = {}<EOL>problems = False<EOL>for dist in get_installed_distributions(**kwargs):<EOL><INDENT>name = canonicalize_name(dist.project_name)<EOL>try:<EOL><INDENT>package_set[name] = PackageDetails(dist.version, dist.requires())<EOL><DEDENT>except RequirementParseError as e:<EOL><INDENT>logging.warning("<STR_LIT>", name, e)<EOL>problems = True<EOL><DEDENT><DEDENT>return package_set, problems<EOL>
Converts a list of distributions into a PackageSet.