func sharedCPUsPreference(pod cache.Pod, container cache.Container) (bool, bool) {
	key := preferSharedCPUsKey
	value, ok := pod.GetEffectiveAnnotation(key, container.GetName())
	if !ok {
		return podSharedCPUPreference(pod, container)
	}
	preference, err := strconv.ParseBool(value)
	if err != nil {
		log.Error("invalid shared CPU preference annotation (%q, %q): %v",
			key, value, err)
		return opt.PreferShared, false
	}
	log.Debug("%s: effective shared CPU preference %v", container.PrettyName(), preference)
	return preference, true
}
sharedCPUsPreference returns whether shared CPUs should be preferred for
containers otherwise eligible for exclusive allocation, and whether the
container was explicitly annotated with this setting.

If the effective annotations are not found, this function falls back to
looking for the deprecated syntax by calling podSharedCPUPreference.
package topologyaware
import (
	"encoding/json"
	"fmt"
	"strconv"
	"strings"
	"time"
	"sigs.k8s.io/yaml"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"github.com/intel/cri-resource-manager/pkg/config"
	"github.com/intel/cri-resource-manager/pkg/cri/resource-manager/cache"
	"github.com/intel/cri-resource-manager/pkg/cri/resource-manager/kubernetes"
)
const (
	keyIsolationPreference = "prefer-isolated-cpus"
	keySharedCPUPreference = "prefer-shared-cpus"
	keyMemoryTypePreference = "memory-type"
	keyColdStartPreference = "cold-start"
	preferIsolatedCPUsKey = keyIsolationPreference + "." + kubernetes.ResmgrKeyNamespace
	preferSharedCPUsKey = keySharedCPUPreference + "." + kubernetes.ResmgrKeyNamespace
	preferMemoryTypeKey = keyMemoryTypePreference + "." + kubernetes.ResmgrKeyNamespace
	preferColdStartKey = keyColdStartPreference + "." + kubernetes.ResmgrKeyNamespace
)
type cpuClass int
var cpuClassNames = map[cpuClass]string{
	cpuNormal:   "normal",
	cpuReserved: "reserved",
}
const (
	cpuNormal cpuClass = iota
	cpuReserved
)
var memoryNamedTypes = map[string]memoryType{
	"dram":  memoryDRAM,
	"pmem":  memoryPMEM,
	"hbm":   memoryHBM,
	"mixed": memoryAll,
}
var memoryTypeNames = map[memoryType]string{
	memoryDRAM: "DRAM",
	memoryPMEM: "PMEM",
	memoryHBM:  "HBM",
}
type memoryType int
const (
	memoryUnspec memoryType = (0x1 << iota) >> 1
	memoryDRAM
	memoryPMEM
	memoryHBM
	memoryFirstUnusedBit
	memoryAll = memoryFirstUnusedBit - 1
	defaultMemoryType = memoryAll
)
func isolatedCPUsPreference(pod cache.Pod, container cache.Container) (bool, bool) {
	key := preferIsolatedCPUsKey
	value, ok := pod.GetEffectiveAnnotation(key, container.GetName())
	if !ok {
		return podIsolationPreference(pod, container)
	}
	preference, err := strconv.ParseBool(value)
	if err != nil {
		log.Error("invalid CPU isolation preference annotation (%q, %q): %v",
			key, value, err)
		return opt.PreferIsolated, false
	}
	log.Debug("%s: effective CPU isolation preference %v", container.PrettyName(), preference)
	return preference, true
}