def get_intersection(self, range_):
result = []<EOL>for entry in self.entries:<EOL><INDENT>package, value = entry<EOL>if value is None:<EOL><INDENT>continue  <EOL><DEDENT>if package.version not in range_:<EOL><INDENT>continue<EOL><DEDENT>if isinstance(value, list):<EOL><INDENT>variants = value<EOL>entry_ = _PackageEntry(package, variants, self.solver)<EOL>result.append(entry_)<EOL>continue<EOL><DEDENT>if self.solver.package_filter:<EOL><INDENT>rule = self.solver.package_filter.excludes(package)<EOL>if rule:<EOL><INDENT>if config.debug_package_exclusions:<EOL><INDENT>print_debug("<STR_LIT>"<EOL>% (package.qualified_name, str(rule)))<EOL><DEDENT>entry[<NUM_LIT:1>] = None<EOL>continue<EOL><DEDENT><DEDENT>if self.solver.package_load_callback:<EOL><INDENT>self.solver.package_load_callback(package)<EOL><DEDENT>variants_ = []<EOL>for var in package.iter_variants():<EOL><INDENT>variant = PackageVariant(var, self.solver.building)<EOL>variants_.append(variant)<EOL><DEDENT>entry[<NUM_LIT:1>] = variants_<EOL>entry_ = _PackageEntry(package, variants_, self.solver)<EOL>result.append(entry_)<EOL><DEDENT>return result or None<EOL>
Get a list of variants that intersect with the given range.

        Args:
            range_ (`VersionRange`): Package version range.

        Returns:
            List of `_PackageEntry` objects.