for details on the apt_preferences format : man apt_preferences

type pin_t =
  1. | Release of (string * string) list
  2. | Origin of string
  3. | Version of string
type package_t =
  1. | Package of string
  2. | Star
type pin_priority_t = int
type apt_preferences = {
  1. package : package_t;
  2. pin : pin_t;
  3. pin_priority : pin_priority_t;
}