code: def get_variant_slice(self, package_name, range_):
          
          variant_list = self.variant_lists.get(package_name)
  
          if variant_list is None:
              variant_list = _PackageVariantList(package_name, self.solver)
              self.variant_lists[package_name] = variant_list
  
          entries = variant_list.get_intersection(range_)
          if not entries:
              return None
  
          slice_ = _PackageVariantSlice(package_name,
                                        entries=entries,
                                        solver=self.solver)
          return slice_
docs: Get a list of variants from the cache.
  
          Args:
              package_name (str): Name of package.
              range_ (`VersionRange`): Package version range.
  
          Returns:
              `_PackageVariantSlice` object.